diff options
| author | Markus Roberts <Markus@reality.com> | 2010-11-04 13:53:23 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2010-11-12 15:02:00 +1100 |
| commit | b15231df5842df2ea83b779b22e6756e51bc39d0 (patch) | |
| tree | 34978db4a199ccca92e35c66e154851bc60fff27 /spec/unit/provider | |
| parent | ea435a43dc97487d054271a9efb208f361408339 (diff) | |
Fix for #4299 -- Don't require which
We already had an internal implementation of which hiding under an assumed
name (Puppet::Util.binary); this commit calls it out of hiding and uses it
consisantly.
Diffstat (limited to 'spec/unit/provider')
| -rwxr-xr-x | spec/unit/provider/confine/exists_spec.rb | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/spec/unit/provider/confine/exists_spec.rb b/spec/unit/provider/confine/exists_spec.rb index c3958e317..f039208b8 100755 --- a/spec/unit/provider/confine/exists_spec.rb +++ b/spec/unit/provider/confine/exists_spec.rb @@ -39,25 +39,18 @@ describe Puppet::Provider::Confine::Exists do describe "and the confine is for binaries" do before { @confine.stubs(:for_binary).returns true } - it "should use its 'binary' method to look up the full path of the file" do - @confine.expects(:binary).returns nil + it "should use its 'which' method to look up the full path of the file" do + @confine.expects(:which).returns nil @confine.pass?("/my/file") end - it "should return false if no binary can be found" do - @confine.expects(:binary).with("/my/file").returns nil + it "should return false if no executable can be found" do + @confine.expects(:which).with("/my/file").returns nil @confine.pass?("/my/file").should be_false end - it "should return true if the binary can be found and the file exists" do - @confine.expects(:binary).with("/my/file").returns "/my/file" - FileTest.expects(:exist?).with("/my/file").returns true - @confine.pass?("/my/file").should be_true - end - - it "should return false if the binary can be found but the file does not exist" do - @confine.expects(:binary).with("/my/file").returns "/my/file" - FileTest.expects(:exist?).with("/my/file").returns true + it "should return true if the executable can be found" do + @confine.expects(:which).with("/my/file").returns "/my/file" @confine.pass?("/my/file").should be_true end end |
