summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-09-29 14:30:33 -0700
committerMarkus Roberts <Markus@reality.com>2010-09-29 18:13:36 -0700
commitea49d13192fce5e891a5ea767ecf05fc3107a411 (patch)
tree3bf095f3bcd1a13979f7ed1d92ca953c6bf0be31 /spec
parent0b4ce0898652268a772bfa1cb66cf67f41963d2b (diff)
downloadpuppet-ea49d13192fce5e891a5ea767ecf05fc3107a411.tar.gz
puppet-ea49d13192fce5e891a5ea767ecf05fc3107a411.tar.xz
puppet-ea49d13192fce5e891a5ea767ecf05fc3107a411.zip
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.
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/provider/service/launchd_spec.rb4
1 files changed, 3 insertions, 1 deletions
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