summaryrefslogtreecommitdiff
path: root/chef/spec/unit
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2010-10-29 13:55:25 -0700
committerBryan McLellan <btm@opscode.com>2011-02-07 15:57:14 -0800
commita678f430ef91fd7ad6af3f8b3353f96d12c5150e (patch)
tree95af906eba9a94db42b478ed2a463954fade48cc /chef/spec/unit
parent9820d6f5e7c00bc1421f03d2028a5f147ae9dc53 (diff)
downloadchef-a678f430ef91fd7ad6af3f8b3353f96d12c5150e.tar.gz
CHEF-1794: refactor priority discovery to better ascertain service startup state
Diffstat (limited to 'chef/spec/unit')
-rw-r--r--chef/spec/unit/provider/service/debian_service_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/chef/spec/unit/provider/service/debian_service_spec.rb b/chef/spec/unit/provider/service/debian_service_spec.rb
index 153e4a5ddd..8f1a6a0b93 100644
--- a/chef/spec/unit/provider/service/debian_service_spec.rb
+++ b/chef/spec/unit/provider/service/debian_service_spec.rb
@@ -61,7 +61,7 @@ Removing any system startup links for /etc/init.d/chef ...
end
it "says the service is enabled" do
- @provider.service_currently_enabled?.should be_true
+ @provider.service_currently_enabled?(@provider.get_priority).should be_true
end
it "stores the 'enabled' state" do
@@ -158,7 +158,18 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop"
@provider.load_current_resource.should equal(@current_resource)
@current_resource.enabled.should be_false
end
+ it "stores the start/stop priorities of the service" do
+ @provider.load_current_resource
+ expected_priorities = {"6"=>[:stop, "20"],
+ "0"=>[:stop, "20"],
+ "1"=>[:stop, "20"],
+ "2"=>[:start, "20"],
+ "3"=>[:start, "20"],
+ "4"=>[:start, "20"],
+ "5"=>[:start, "20"]}
+ @provider.current_resource.priority.should == expected_priorities
end
+
end
describe "when update-rc.d fails" do
@@ -168,7 +179,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop"
end
it "raises an error" do
- lambda { @provider.service_currently_enabled? }.should raise_error(Chef::Exceptions::Service)
+ lambda { @provider.service_currently_enabled?(@provider.get_priority) }.should raise_error(Chef::Exceptions::Service)
end
end