summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-15 05:48:43 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-15 05:48:43 +0000
commit39aaa9910f8bc5a120f35233d6dda0b06150747b (patch)
tree66029bd2f6805d6089c18851b1886a01bd06e385 /test
parent6c6ff03155101cebbd4ba76ce09cc23adf45f9f7 (diff)
downloadpuppet-39aaa9910f8bc5a120f35233d6dda0b06150747b.tar.gz
puppet-39aaa9910f8bc5a120f35233d6dda0b06150747b.tar.xz
puppet-39aaa9910f8bc5a120f35233d6dda0b06150747b.zip
fixing some tests
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@667 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/tc_snippets.rb18
-rwxr-xr-xtest/types/tc_filebucket.rb2
-rwxr-xr-xtest/types/tc_filesources.rb20
3 files changed, 6 insertions, 34 deletions
diff --git a/test/language/tc_snippets.rb b/test/language/tc_snippets.rb
index f206cb2fc..a37404844 100755
--- a/test/language/tc_snippets.rb
+++ b/test/language/tc_snippets.rb
@@ -23,7 +23,7 @@ require 'puppettest'
# so really, we want to do things like test that our ast is correct
# and test whether we've got things in the right scopes
-class TestSnippets < Test::Unit::TestCase
+class TestSnippets < TestPuppet
$snippetbase = File.join($puppetbase, "examples", "code", "snippets")
def file2ast(file)
@@ -161,20 +161,6 @@ class TestSnippets < Test::Unit::TestCase
}
end
- def setup
- Puppet[:loglevel] = :debug if __FILE__ == $0
- @@tmpfiles = []
- end
-
- def teardown
- @@tmpfiles.flatten.each { |file|
- if FileTest.exists?(file)
- system("rm -rf %s" % file)
- end
- }
- Puppet::Type.allclear
- end
-
# this is here in case no tests get defined; otherwise we get a warning
def test_nothing
end
@@ -217,7 +203,7 @@ class TestSnippets < Test::Unit::TestCase
files = %w{a b c d}.collect { |letter|
"/tmp/snippetselect%stest" % letter
}
- @@tmpfiles << files
+ @@tmpfiles += files
files.each { |file|
assert(FileTest.exists?(file))
diff --git a/test/types/tc_filebucket.rb b/test/types/tc_filebucket.rb
index 6a2fd6c50..fe4971136 100755
--- a/test/types/tc_filebucket.rb
+++ b/test/types/tc_filebucket.rb
@@ -11,7 +11,7 @@ require 'puppettest'
# $Id$
-class TestFileBucket < Test::Unit::TestCase
+class TestFileBucket < TestPuppet
include FileTesting
# hmmm
# this is complicated, because we store references to the created
diff --git a/test/types/tc_filesources.rb b/test/types/tc_filesources.rb
index 88699bcb5..de35e1d93 100755
--- a/test/types/tc_filesources.rb
+++ b/test/types/tc_filesources.rb
@@ -13,11 +13,8 @@ require 'puppettest'
# $Id$
-class TestFileSources < Test::Unit::TestCase
+class TestFileSources < TestPuppet
include FileTesting
- # hmmm
- # this is complicated, because we store references to the created
- # objects in a central store
=begin
def mkfile(hash)
@@ -38,31 +35,20 @@ class TestFileSources < Test::Unit::TestCase
end
=end
def setup
- @@tmpfiles = []
- @@tmppids = []
- Puppet[:loglevel] = :debug if __FILE__ == $0
- Puppet[:checksumfile] = File.join(Puppet[:statedir], "checksumtestfile")
begin
initstorage
rescue
system("rm -rf %s" % Puppet[:checksumfile])
end
+ super
end
def teardown
clearstorage
- Puppet::Type.allclear
@@tmppids.each { |pid|
system("kill -INT %s" % pid)
}
- @@tmpfiles.each { |file|
- if FileTest.exists?(file)
- system("chmod -R 755 %s" % file)
- system("rm -rf %s" % file)
- end
- }
- @@tmpfiles.clear
- system("rm -f %s" % Puppet[:checksumfile])
+ super
end
def initstorage