summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-07-20 20:23:19 +0000
committerLuke Kanies <luke@madstop.com>2005-07-20 20:23:19 +0000
commit2d34f8e9ddcfc03d57a71819810eef15fb7f965f (patch)
tree6635244f6d9c1b8885470e2541921f579b1b191d /test
parentbc38169686aa294c191382796ab3f9d6c4e96316 (diff)
Ha! finally got recursion and sourcing working together
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@431 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/types/tc_file.rb46
1 files changed, 39 insertions, 7 deletions
diff --git a/test/types/tc_file.rb b/test/types/tc_file.rb
index ffb3b4f91..e0ae7274d 100644
--- a/test/types/tc_file.rb
+++ b/test/types/tc_file.rb
@@ -326,8 +326,39 @@ class TestFile < Test::Unit::TestCase
@@tmpfiles.push path
end
+ def test_newchild
+ path = "/tmp/newchilddir"
+ @@tmpfiles.push path
+
+ system("mkdir -p #{path}")
+ File.open(File.join(path,"childtest"), "w") { |of|
+ of.puts "yayness"
+ }
+ file = nil
+ comp = nil
+ trans = nil
+ assert_nothing_raised {
+ file = Puppet::Type::PFile.new(
+ :name => path
+ )
+ }
+ child = nil
+ assert_nothing_raised {
+ child = file.newchild("childtest")
+ }
+ assert(child)
+ assert_nothing_raised {
+ child = file.newchild("childtest")
+ }
+ assert(child)
+ assert_raise(Puppet::DevError) {
+ file.newchild(File.join(path,"childtest"))
+ }
+ end
+
def test_simplelocalsource
- path = "/tmp/filesourcetest"
+ path = "/tmp/Filesourcetest"
+ @@tmpfiles.push path
system("mkdir -p #{path}")
frompath = File.join(path,"source")
topath = File.join(path,"dest")
@@ -385,7 +416,7 @@ class TestFile < Test::Unit::TestCase
return ret
end
- def mkranddirsandfiles(dirs = nil,files = nil,depth = 4)
+ def mkranddirsandfiles(dirs = nil,files = nil,depth = 2)
if depth < 0
return
end
@@ -489,7 +520,7 @@ class TestFile < Test::Unit::TestCase
end
def test_xcomplicatedlocalsource
- path = "/tmp/complsourcetest"
+ path = "/tmp/Complsourcetest"
@@tmpfiles.push path
system("mkdir -p #{path}")
@@ -500,9 +531,10 @@ class TestFile < Test::Unit::TestCase
mkranddirsandfiles()
}
- 2.times {
+ 2.times { |index|
+ Puppet.err "Take %s" % index
initstorage
- todir = File.join(path,"todir")
+ todir = File.join(path,"Todir")
tofile = nil
trans = nil
@@ -532,7 +564,7 @@ class TestFile < Test::Unit::TestCase
end
def test_copywithfailures
- path = "/tmp/failuresourcetest"
+ path = "/tmp/Failuresourcetest"
@@tmpfiles.push path
system("mkdir -p #{path}")
@@ -543,7 +575,7 @@ class TestFile < Test::Unit::TestCase
mkranddirsandfiles()
}
- todir = File.join(path,"todir")
+ todir = File.join(path,"Todir")
tofile = nil
trans = nil