summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-31 23:23:57 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-09-01 21:06:07 +1000
commite589cd39cc1d76de59cf4758bb986fa15f64571c (patch)
treecb889cc886fc45a5837dc9161291cfe215fe5e88 /spec
parent3342b73b6acf5e7c492fa352b16ba9aba3c60da8 (diff)
downloadpuppet-e589cd39cc1d76de59cf4758bb986fa15f64571c.tar.gz
puppet-e589cd39cc1d76de59cf4758bb986fa15f64571c.tar.xz
puppet-e589cd39cc1d76de59cf4758bb986fa15f64571c.zip
Fixing #2582 - / no longer autorequires /
This was obviously resulting in a dep cycle. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/type/file.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb
index 6ec86e7a1..1b3fe6a60 100755
--- a/spec/unit/type/file.rb
+++ b/spec/unit/type/file.rb
@@ -71,6 +71,24 @@ describe Puppet::Type.type(:file) do
@file.must_not be_should_be_file
end
+ it "should autorequire its parent directory" do
+ catalog = Puppet::Resource::Catalog.new
+ file = Puppet::Type::File.new(:name => "/foo/bar")
+ dir = Puppet::Type::File.new(:name => "/foo")
+ catalog.add_resource file
+ catalog.add_resource dir
+ reqs = file.autorequire
+ reqs[0].source.must == dir
+ reqs[0].target.must == file
+ end
+
+ it "should not autorequire its parent dir if its parent dir is itself" do
+ catalog = Puppet::Resource::Catalog.new
+ file = Puppet::Type::File.new(:name => "/")
+ catalog.add_resource file
+ file.autorequire.should be_empty
+ end
+
describe "when validating attributes" do
%w{path backup recurse recurselimit source replace force ignore links purge sourceselect}.each do |attr|
it "should have a '#{attr}' parameter" do