summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAbhishekKr <abhikumar163@gmail.com>2016-06-29 04:11:49 +0530
committerAbhishekKr <abhikumar163@gmail.com>2016-06-29 04:11:49 +0530
commit58e147a9dfa331c359df2c9a2bcc53a27a722ef5 (patch)
tree0502c5ac204d84a063aa10060cc14bc4909a1729 /spec
parent5c76329a9fcae1116929cf50c48608d2aa70872c (diff)
downloadchef-58e147a9dfa331c359df2c9a2bcc53a27a722ef5.tar.gz
service - upstart restart - fixing specs and call of stop
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/service/upstart_service_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/provider/service/upstart_service_spec.rb b/spec/unit/provider/service/upstart_service_spec.rb
index fd9ea0573c..0692bdb64a 100644
--- a/spec/unit/provider/service/upstart_service_spec.rb
+++ b/spec/unit/provider/service/upstart_service_spec.rb
@@ -295,9 +295,11 @@ describe Chef::Provider::Service::Upstart do
@provider.restart_service()
end
- it "should call '/sbin/restart service_name' if no restart command is specified" do
+ it "should call start/sleep/stop if no restart command is specified" do
allow(@current_resource).to receive(:running).and_return(true)
- expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/restart #{@new_resource.service_name}").and_return(shell_out_success)
+ expect(@provider).to receive(:stop_service)
+ expect(@provider).to receive(:sleep).with(1)
+ expect(@provider).to receive(:start_service)
@provider.restart_service()
end