+1.  Confirmed passing on non-osx system and I'm very much in favor of
stubbing out specific methods (careful not to overstub) instead of
using confines.

On Wed, Sep 29, 2010 at 2:53 PM, Paul Berry <[email protected]> wrote:
> 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.
>
> Signed-off-by: Paul Berry <[email protected]>
> ---
>  spec/unit/provider/service/launchd_spec.rb |    4 +++-
>  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 05d7697..43e4cba 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
> --
> 1.7.2
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to