summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-09-03 13:43:30 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-09-08 11:10:06 -0700
commitc8a9c9bb2d0960fad20d09c029f301e690dfcc15 (patch)
treed06b5798e244e792a8e1fa8efdf08d0b3a2ea0d5
parent0d88d5637bbf9938fe03804a517199d2c31ae473 (diff)
downloadchef-c8a9c9bb2d0960fad20d09c029f301e690dfcc15.tar.gz
spec fixes for init service
-rw-r--r--spec/unit/provider/service/init_service_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb
index ad887c84a5..b523f6d3a9 100644
--- a/spec/unit/provider/service/init_service_spec.rb
+++ b/spec/unit/provider/service/init_service_spec.rb
@@ -100,7 +100,7 @@ PS
end
it "should use the init_command if one has been specified" do
- @provider.should_receive(:shell_out!).with("/opt/chef-server/service/erchef start")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/opt/chef-server/service/erchef start")
@provider.start_service
end
@@ -126,7 +126,6 @@ PS
end
-
describe "when we have a 'ps' attribute" do
it "should shell_out! the node's ps command" do
@provider.should_receive(:shell_out!).and_return(@status)
@@ -165,12 +164,12 @@ RUNNING_PS
describe "when starting the service" do
it "should call the start command if one is specified" do
@new_resource.start_command("/etc/init.d/chef startyousillysally")
- @provider.should_receive(:shell_out!).with("/etc/init.d/chef startyousillysally")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef startyousillysally")
@provider.start_service()
end
it "should call '/etc/init.d/service_name start' if no start command is specified" do
- @provider.should_receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} start")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} start")
@provider.start_service()
end
end
@@ -178,12 +177,12 @@ RUNNING_PS
describe Chef::Provider::Service::Init, "stop_service" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/etc/init.d/chef itoldyoutostop")
- @provider.should_receive(:shell_out!).with("/etc/init.d/chef itoldyoutostop")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef itoldyoutostop")
@provider.stop_service()
end
it "should call '/etc/init.d/service_name stop' if no stop command is specified" do
- @provider.should_receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} stop")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} stop")
@provider.stop_service()
end
end
@@ -191,13 +190,13 @@ RUNNING_PS
describe "when restarting a service" do
it "should call 'restart' on the service_name if the resource supports it" do
@new_resource.supports({:restart => true})
- @provider.should_receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} restart")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} restart")
@provider.restart_service()
end
it "should call the restart_command if one has been specified" do
@new_resource.restart_command("/etc/init.d/chef restartinafire")
- @provider.should_receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} restartinafire")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} restartinafire")
@provider.restart_service()
end
@@ -212,13 +211,13 @@ RUNNING_PS
describe "when reloading a service" do
it "should call 'reload' on the service if it supports it" do
@new_resource.supports({:reload => true})
- @provider.should_receive(:shell_out!).with("/etc/init.d/chef reload")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef reload")
@provider.reload_service()
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
@new_resource.reload_command("/etc/init.d/chef lollerpants")
- @provider.should_receive(:shell_out!).with("/etc/init.d/chef lollerpants")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef lollerpants")
@provider.reload_service()
end
end
@@ -226,6 +225,7 @@ RUNNING_PS
describe "when a custom command has been specified" do
before do
@new_resource.start_command("/etc/init.d/chef startyousillysally")
+ @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef startyousillysally")
end
it "should still pass all why run assertions" do