diff options
| -rw-r--r-- | lib/puppet/module.rb | 6 | ||||
| -rwxr-xr-x | spec/unit/module.rb | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index f30b862ef..e598a8e88 100644 --- a/lib/puppet/module.rb +++ b/lib/puppet/module.rb @@ -126,10 +126,10 @@ class Puppet::Module return find_init_manifest unless rest # Use init.pp rest ||= "init.pp" - p = File::join(path, MANIFESTS, rest) - result = Dir.glob(p).reject { |f| FileTest.directory?(f) } + full_path = File::join(path, MANIFESTS, rest) + result = Dir.glob(full_path).reject { |f| FileTest.directory?(f) } if result.size == 0 and rest !~ /\.pp$/ - result = Dir.glob(p + ".pp") + result = Dir.glob(full_path + ".pp") end result.flatten.compact end diff --git a/spec/unit/module.rb b/spec/unit/module.rb index e6623befd..85cc84116 100755 --- a/spec/unit/module.rb +++ b/spec/unit/module.rb @@ -405,6 +405,7 @@ describe Puppet::Module, "when finding matching manifests" do it "should return all manifests matching the glob pattern" do Dir.expects(:glob).with("/a/manifests/yay/*.pp").returns(%w{foo bar}) + FileTest.stubs(:directory?).returns false @mod.match_manifests("yay/*.pp").should == %w{foo bar} end |
