diff options
author | Luke Kanies <luke@madstop.com> | 2008-08-28 23:09:52 -0700 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-08-28 23:09:52 -0700 |
commit | bd1163a339ff66dbb9a50a1cb13f6320cb056cc3 (patch) | |
tree | 73c539efd401a5a1880cc5b74ce2eee94e9c98b3 | |
parent | 5da26067cc76ad318359d9287ab1267d7a6c5b0b (diff) | |
download | puppet-bd1163a339ff66dbb9a50a1cb13f6320cb056cc3.tar.gz puppet-bd1163a339ff66dbb9a50a1cb13f6320cb056cc3.tar.xz puppet-bd1163a339ff66dbb9a50a1cb13f6320cb056cc3.zip |
Fixing filesets to allow nil ignore values.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | lib/puppet/file_serving/fileset.rb | 2 | ||||
-rwxr-xr-x | spec/unit/file_serving/fileset.rb | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb index 80a718c68..a90734a2b 100644 --- a/lib/puppet/file_serving/fileset.rb +++ b/lib/puppet/file_serving/fileset.rb @@ -30,6 +30,8 @@ class Puppet::FileServing::Fileset # Should we ignore this path? def ignore?(path) + return false if @ignore == [nil] + # 'detect' normally returns the found result, whereas we just want true/false. ! @ignore.detect { |pattern| File.fnmatch?(pattern, path) }.nil? end diff --git a/spec/unit/file_serving/fileset.rb b/spec/unit/file_serving/fileset.rb index 2cd3e83dd..f95271050 100755 --- a/spec/unit/file_serving/fileset.rb +++ b/spec/unit/file_serving/fileset.rb @@ -149,6 +149,13 @@ describe Puppet::FileServing::Fileset, " when recursing" do @fileset.files.sort.should == @files.sort end + it "should function if the :ignore value provided is nil" do + mock_dir_structure(@path) + @fileset.recurse = true + @fileset.ignore = nil + lambda { @fileset.files }.should_not raise_error + end + it "should ignore files that match a single pattern in the ignore list" do mock_dir_structure(@path) @fileset.recurse = true |