summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2014-04-22 21:11:34 -0700
committerdanielsdeleo <dan@getchef.com>2014-04-24 09:49:52 -0700
commit03db320b200d13ba8980d7c104e955cf2ba7aa53 (patch)
treea3adf74f62ebe0050cfd38dbec3ddf56c1bf8c66 /spec/unit/provider/service
parentbfc0b5a5f5e7cc5255a2bc20b50cc2599ec4d7f6 (diff)
downloadchef-03db320b200d13ba8980d7c104e955cf2ba7aa53.tar.gz
Fix rspec warnings
Diffstat (limited to 'spec/unit/provider/service')
-rw-r--r--spec/unit/provider/service/solaris_smf_service_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/unit/provider/service/solaris_smf_service_spec.rb b/spec/unit/provider/service/solaris_smf_service_spec.rb
index af1351a4ff..8e66289a80 100644
--- a/spec/unit/provider/service/solaris_smf_service_spec.rb
+++ b/spec/unit/provider/service/solaris_smf_service_spec.rb
@@ -54,14 +54,14 @@ describe Chef::Provider::Service::Solaris do
describe "when discovering the current service state" do
it "should create a current resource with the name of the new resource" do
- @provider.stub!(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
+ @provider.stub(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
Chef::Resource::Service.should_receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should return the current resource" do
- @provider.stub!(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
+ @provider.stub(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
@provider.load_current_resource.should eql(@current_resource)
end
@@ -71,27 +71,27 @@ describe Chef::Provider::Service::Solaris do
end
it "should mark service as not running" do
- @provider.stub!(:shell_out!).and_return(@status)
+ @provider.stub(:shell_out!).and_return(@status)
@current_resource.should_receive(:running).with(false)
@provider.load_current_resource
end
it "should mark service as running" do
- @status = mock("Status", :exitstatus => 0, :stdout => 'state online')
- @provider.stub!(:shell_out!).and_return(@status)
+ @status = double("Status", :exitstatus => 0, :stdout => 'state online')
+ @provider.stub(:shell_out!).and_return(@status)
@current_resource.should_receive(:running).with(true)
@provider.load_current_resource
end
it "should not mark service as maintenance" do
- @provider.stub!(:shell_out!).and_return(@status)
+ @provider.stub(:shell_out!).and_return(@status)
@provider.load_current_resource
@provider.maintenance.should be_false
end
it "should mark service as maintenance" do
- @status = mock("Status", :exitstatus => 0, :stdout => 'state maintenance')
- @provider.stub!(:shell_out!).and_return(@status)
+ @status = double("Status", :exitstatus => 0, :stdout => 'state maintenance')
+ @provider.stub(:shell_out!).and_return(@status)
@provider.load_current_resource
@provider.maintenance.should be_true
end
@@ -104,7 +104,7 @@ describe Chef::Provider::Service::Solaris do
end
it "should call svcadm enable -s chef" do
- @new_resource.stub!(:enable_command).and_return("#{@new_resource.enable_command}")
+ @new_resource.stub(:enable_command).and_return("#{@new_resource.enable_command}")
@provider.should_not_receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}")
@provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
@provider.enable_service.should be_true
@@ -112,7 +112,7 @@ describe Chef::Provider::Service::Solaris do
end
it "should call svcadm enable -s chef for start_service" do
- @new_resource.stub!(:start_command).and_return("#{@new_resource.start_command}")
+ @new_resource.stub(:start_command).and_return("#{@new_resource.start_command}")
@provider.should_not_receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}")
@provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
@provider.start_service.should be_true
@@ -120,10 +120,10 @@ describe Chef::Provider::Service::Solaris do
end
it "should call svcadm clear chef for start_service when state maintenance" do
- @status = mock("Status", :exitstatus => 0, :stdout => 'state maintenance')
- @provider.stub!(:shell_out!).and_return(@status)
+ @status = double("Status", :exitstatus => 0, :stdout => 'state maintenance')
+ @provider.stub(:shell_out!).and_return(@status)
@provider.load_current_resource
- @new_resource.stub!(:enable_command).and_return("#{@new_resource.enable_command}")
+ @new_resource.stub(:enable_command).and_return("#{@new_resource.enable_command}")
@provider.should_receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}").and_return(@status)
@provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
@provider.enable_service.should be_true