diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2010-06-17 17:49:29 -0700 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2010-06-27 03:48:07 +1000 |
| commit | 34d189725c82e221793dc51c04ecb68e43ed3115 (patch) | |
| tree | f7940110616690ee8b05527c3988c4e2e96263aa /spec | |
| parent | 9d0d94c27174bc25ba823028a612f8fa04dd847b (diff) | |
[#3835] Fixed recursively absent directories improperly managing their files
Children of recursively absent (and only recursively absent) directories now
inherit the recursively absent behavior when they are created. This stops the
files from trying to be created, generating lots of failure messages. This
doesn't affect directories which are absent and not recursive (whose children
aren't even attempted to be created, or directories which aren't absent.
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/type/file.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb index 206a50ed9..b2f12927f 100755 --- a/spec/unit/type/file.rb +++ b/spec/unit/type/file.rb @@ -694,6 +694,14 @@ describe Puppet::Type.type(:file) do end end + it "should pass on ensure and recurse to the sub resource if ensure is absent and recurse is true" do + @file = Puppet::Type::File.new(:name => "/foo/bar", :ensure => :absent, :recurse => true, :catalog => @catalog) + + @file.class.expects(:new).with { |params| params[:ensure] == :absent and params[:recurse] == true } + + @file.newchild("my/path") + end + it "should copy all of the parent resource's 'should' values that were set at initialization" do file = @file.class.new(:path => "/foo/bar", :owner => "root", :group => "wheel") @catalog.add_resource(file) |
