summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-29 14:17:47 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-29 14:17:47 -0800
commitb19b7d000887209f9d8dc1dc6aa468a0497a7391 (patch)
tree68d1eb6c136df20c2800f1dddb4e2c1ed5d75a42 /spec/unit/provider/service_spec.rb
parentb5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff)
downloadchef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/unit/provider/service_spec.rb')
-rw-r--r--spec/unit/provider/service_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/provider/service_spec.rb b/spec/unit/provider/service_spec.rb
index 3719af56f2..7ddc01ff0b 100644
--- a/spec/unit/provider/service_spec.rb
+++ b/spec/unit/provider/service_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Provider::Service do
@provider = Chef::Provider::Service.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @provider.stub!(:load_current_resource)
+ @provider.stub(:load_current_resource)
end
describe "when enabling the service" do
@@ -52,14 +52,14 @@ describe Chef::Provider::Service do
describe "when disabling the service" do
it "should disable the service if enabled and set the resource as updated" do
- @current_resource.stub!(:enabled).and_return(true)
+ @current_resource.stub(:enabled).and_return(true)
@provider.should_receive(:disable_service).and_return(true)
@provider.run_action(:disable)
@provider.new_resource.should be_updated
end
it "should not disable the service if already disabled" do
- @current_resource.stub!(:enabled).and_return(false)
+ @current_resource.stub(:enabled).and_return(false)
@provider.should_not_receive(:disable_service)
@provider.run_action(:disable)
@provider.new_resource.should_not be_updated
@@ -84,14 +84,14 @@ describe Chef::Provider::Service do
describe "action_stop" do
it "should stop the service if it is running and set the resource as updated" do
- @current_resource.stub!(:running).and_return(true)
+ @current_resource.stub(:running).and_return(true)
@provider.should_receive(:stop_service).and_return(true)
@provider.run_action(:stop)
@provider.new_resource.should be_updated
end
it "should not stop the service if it's already stopped" do
- @current_resource.stub!(:running).and_return(false)
+ @current_resource.stub(:running).and_return(false)
@provider.should_not_receive(:stop_service)
@provider.run_action(:stop)
@provider.new_resource.should_not be_updated
@@ -110,7 +110,7 @@ describe Chef::Provider::Service do
end
it "should restart the service even if it isn't running and set the resource as updated" do
- @current_resource.stub!(:running).and_return(false)
+ @current_resource.stub(:running).and_return(false)
@provider.should_receive(:restart_service).and_return(true)
@provider.run_action(:restart)
@provider.new_resource.should be_updated
@@ -124,19 +124,19 @@ describe Chef::Provider::Service do
it "should raise an exception if reload isn't supported" do
@new_resource.supports(:reload => false)
- @new_resource.stub!(:reload_command).and_return(false)
+ @new_resource.stub(:reload_command).and_return(false)
lambda { @provider.run_action(:reload) }.should raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should reload the service if it is running and set the resource as updated" do
- @current_resource.stub!(:running).and_return(true)
+ @current_resource.stub(:running).and_return(true)
@provider.should_receive(:reload_service).and_return(true)
@provider.run_action(:reload)
@provider.new_resource.should be_updated
end
it "should not reload the service if it's stopped" do
- @current_resource.stub!(:running).and_return(false)
+ @current_resource.stub(:running).and_return(false)
@provider.should_not_receive(:reload_service)
@provider.run_action(:stop)
@provider.new_resource.should_not be_updated