diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2010-07-10 18:52:28 +0200 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-11 09:29:35 -0700 |
| commit | 99d8323ece06ffde0ddfb5753ef94541d473a9d9 (patch) | |
| tree | 5515bf74450cd1615cb8b85a0e3bad11000a79ac /spec/unit/parser | |
| parent | a2115afbe2a5ab83ea5c84896492eaaf62a33507 (diff) | |
| download | puppet-99d8323ece06ffde0ddfb5753ef94541d473a9d9.tar.gz puppet-99d8323ece06ffde0ddfb5753ef94541d473a9d9.tar.xz puppet-99d8323ece06ffde0ddfb5753ef94541d473a9d9.zip | |
Fix #4206 - import "path/*" tries to import files twice
Due to the glob pattern used, we are trying to import manifests twice.
Since it isn't possible (see #4205), it is not possible to use a pattern
in an import statement.
This patch makes sure manifests are returned only once.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/parser')
| -rw-r--r-- | spec/unit/parser/files_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/parser/files_spec.rb b/spec/unit/parser/files_spec.rb index d1b5491a2..fcfbfa613 100644 --- a/spec/unit/parser/files_spec.rb +++ b/spec/unit/parser/files_spec.rb @@ -173,6 +173,12 @@ describe Puppet::Parser::Files do FileTest.expects(:directory?).with(dir).returns(true) Puppet::Parser::Files.find_manifests(pattern)[1].should == [file] end + + it "should return files once only" do + pattern = @basepath + "/fully/qualified/pattern/*" + Dir.expects(:glob).with(pattern+'{,.pp,.rb}').returns(%w{one two one}) + Puppet::Parser::Files.find_manifests(pattern)[1].should == %w{one two} + end end describe "when searching for manifests in a found module" do |
