summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-17 16:14:36 -0600
committerLuke Kanies <luke@madstop.com>2009-02-18 22:38:43 -0600
commita7be174d249ca581d9ae849ba3823abc2c006b08 (patch)
tree4d386a7e750619dd66c598baa1a0198ac67496bb /spec/unit
parent7ceb437c8f8f545484ebc1236c714f685d5eb7c0 (diff)
downloadpuppet-a7be174d249ca581d9ae849ba3823abc2c006b08.tar.gz
puppet-a7be174d249ca581d9ae849ba3823abc2c006b08.tar.xz
puppet-a7be174d249ca581d9ae849ba3823abc2c006b08.zip
Refactoring Puppet::Module a bit.
No behaviour change here, just some internal changes to make way for methods I want to add. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/module.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/module.rb b/spec/unit/module.rb
index 1deaec232..70dd825d5 100755
--- a/spec/unit/module.rb
+++ b/spec/unit/module.rb
@@ -85,7 +85,7 @@ describe Puppet::Module, " when searching for templates" do
Puppet.settings.expects(:value).with(:templatedir, nil).returns("/my/templates")
Puppet[:modulepath] = "/one:/two"
File.stubs(:directory?).returns(true)
- File.stubs(:exists?).returns(true)
+ FileTest.stubs(:exist?).returns(true)
Puppet::Module.find_template("mymod/mytemplate").should == "/my/templates/mymod/mytemplate"
end
@@ -98,7 +98,7 @@ describe Puppet::Module, " when searching for templates" do
Puppet::Module.stubs(:templatepath).with(nil).returns(nil)
Puppet[:modulepath] = "/one:/two"
File.stubs(:directory?).returns(true)
- File.stubs(:exists?).returns(true)
+ FileTest.stubs(:exist?).returns(true)
Puppet::Module.find_template("mymod/mytemplate").should == "/one/mymod/templates/mytemplate"
end
@@ -134,15 +134,15 @@ describe Puppet::Module, " when searching for templates" do
it "should use a valid dir when templatedir is a path for unqualified templates and the first dir contains template" do
Puppet::Module.stubs(:templatepath).returns(["/one/templates", "/two/templates"])
- File.expects(:exists?).with("/one/templates/mytemplate").returns(true)
+ FileTest.expects(:exist?).with("/one/templates/mytemplate").returns(true)
Puppet::Module.expects(:find).never
Puppet::Module.find_template("mytemplate").should == "/one/templates/mytemplate"
end
it "should use a valid dir when templatedir is a path for unqualified templates and only second dir contains template" do
Puppet::Module.stubs(:templatepath).returns(["/one/templates", "/two/templates"])
- File.expects(:exists?).with("/one/templates/mytemplate").returns(false)
- File.expects(:exists?).with("/two/templates/mytemplate").returns(true)
+ FileTest.expects(:exist?).with("/one/templates/mytemplate").returns(false)
+ FileTest.expects(:exist?).with("/two/templates/mytemplate").returns(true)
Puppet::Module.expects(:find).never
Puppet::Module.find_template("mytemplate").should == "/two/templates/mytemplate"
end