diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-29 14:17:47 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-29 14:17:47 -0800 |
commit | b19b7d000887209f9d8dc1dc6aa468a0497a7391 (patch) | |
tree | 68d1eb6c136df20c2800f1dddb4e2c1ed5d75a42 /spec/unit/provider/cron | |
parent | b5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff) | |
download | chef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz |
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/unit/provider/cron')
-rw-r--r-- | spec/unit/provider/cron/unix_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/provider/cron/unix_spec.rb b/spec/unit/provider/cron/unix_spec.rb index ffdfa198b6..1683fad7a1 100644 --- a/spec/unit/provider/cron/unix_spec.rb +++ b/spec/unit/provider/cron/unix_spec.rb @@ -48,7 +48,7 @@ describe Chef::Provider::Cron::Unix do # Another comment CRONTAB - @provider.stub!(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status) + @provider.stub(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status) end it "should call crontab -l with the user" do @@ -70,13 +70,13 @@ CRONTAB it "should return nil if the user has no crontab" do status = mock("Status", :exitstatus => 1) - @provider.stub!(:popen4).and_return(status) + @provider.stub(:popen4).and_return(status) @provider.send(:read_crontab).should == nil end it "should raise an exception if another error occurs" do status = mock("Status", :exitstatus => 2) - @provider.stub!(:popen4).and_return(status) + @provider.stub(:popen4).and_return(status) lambda do @provider.send(:read_crontab) end.should raise_error(Chef::Exceptions::Cron, "Error determining state of #{@new_resource.name}, exit: 2") @@ -86,9 +86,9 @@ CRONTAB describe "write_crontab" do before :each do @status = mock("Status", :exitstatus => 0) - @provider.stub!(:run_command_and_return_stdout_stderr).and_return(@status, String.new, String.new) + @provider.stub(:run_command_and_return_stdout_stderr).and_return(@status, String.new, String.new) @tempfile = mock("foo", :path => "/tmp/foo", :close => true) - Tempfile.stub!(:new).and_return(@tempfile) + Tempfile.stub(:new).and_return(@tempfile) @tempfile.should_receive(:flush) @tempfile.should_receive(:chmod).with(420) @tempfile.should_receive(:close!) @@ -112,7 +112,7 @@ CRONTAB it "should raise an exception if the command returns non-zero" do @tempfile.should_receive(:<<).with("Foo") - @status.stub!(:exitstatus).and_return(1) + @status.stub(:exitstatus).and_return(1) lambda do @provider.send(:write_crontab, "Foo") end.should raise_error(Chef::Exceptions::Cron, /Error updating state of #{@new_resource.name}, exit: 1/) |