From ea49d13192fce5e891a5ea767ecf05fc3107a411 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Wed, 29 Sep 2010 14:30:33 -0700 Subject: Improvement to #4025: made spec tests work on all platforms The spec test changes for ticket 4025 (binary plist support) failed on non-OSX systems because of a missing stub. Added the missing stub so that the spec tests can now run on all systems. --- spec/unit/provider/service/launchd_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/unit/provider/service/launchd_spec.rb b/spec/unit/provider/service/launchd_spec.rb index 05d76972d..43e4cba8e 100755 --- a/spec/unit/provider/service/launchd_spec.rb +++ b/spec/unit/provider/service/launchd_spec.rb @@ -95,23 +95,25 @@ describe provider_class do end describe "when checking whether the service is enabled on OS X 10.6" do - confine "Not running on OSX" => (Facter.value(:operatingsystem) == "Darwin") it "should return true if the job plist says disabled is true and the global overrides says disabled is false" do provider_class.stubs(:get_macosx_version_major).returns("10.6") @provider.stubs(:plist_from_label).returns(["foo", {"Disabled" => true}]) @provider.class.stubs(:read_plist).returns({@resource[:name] => {"Disabled" => false}}) + FileTest.expects(:file?).with(Launchd_Overrides).returns(true) @provider.enabled?.should == :true end it "should return false if the job plist says disabled is false and the global overrides says disabled is true" do provider_class.stubs(:get_macosx_version_major).returns("10.6") @provider.stubs(:plist_from_label).returns(["foo", {"Disabled" => false}]) @provider.class.stubs(:read_plist).returns({@resource[:name] => {"Disabled" => true}}) + FileTest.expects(:file?).with(Launchd_Overrides).returns(true) @provider.enabled?.should == :false end it "should return true if the job plist and the global overrides have no disabled keys" do provider_class.stubs(:get_macosx_version_major).returns("10.6") @provider.stubs(:plist_from_label).returns(["foo", {}]) @provider.class.stubs(:read_plist).returns({}) + FileTest.expects(:file?).with(Launchd_Overrides).returns(true) @provider.enabled?.should == :true end end -- cgit