summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-03-25 17:17:16 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitb19a0442ed31cedd3846b9e26c25b5ea4b7ff22f (patch)
tree2e4fa8e48a0e9d4a363f7d52cd19e7142d58116c
parent5b2802c73b2220ca5d4125f96d7a094f336a0415 (diff)
downloadpuppet-b19a0442ed31cedd3846b9e26c25b5ea4b7ff22f.tar.gz
puppet-b19a0442ed31cedd3846b9e26c25b5ea4b7ff22f.tar.xz
puppet-b19a0442ed31cedd3846b9e26c25b5ea4b7ff22f.zip
Some tests were leaking state when the test failed
-rwxr-xr-xtest/language/parser.rb8
-rwxr-xr-xtest/language/scope.rb1
2 files changed, 7 insertions, 2 deletions
diff --git a/test/language/parser.rb b/test/language/parser.rb
index 13f4d17b5..ca8ee75f6 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -499,6 +499,8 @@ file { "/tmp/yayness":
check.call(res, "multiresource")
end
end
+
+ ensure
if Puppet.features.rails?
Puppet[:storeconfigs] = false
Puppet::Resource::Catalog.cache_class = catalog_cache_class
@@ -535,6 +537,8 @@ file { "/tmp/yayness":
assert_instance_of(AST::Collection, coll)
assert_equal(form, coll.form)
end
+
+ ensure
if Puppet.features.rails?
Puppet[:storeconfigs] = false
Puppet::Resource::Catalog.cache_class = catalog_cache_class
@@ -643,7 +647,7 @@ file { "/tmp/yayness":
parser.parse %{define one::two { }}
}
assert(parser.definition("one::two"), "Could not find one::two with no namespace")
-
+
# Now try using the definition
assert_nothing_raised("Could not parse fully-qualified definition usage") {
parser.parse %{one::two { yayness: }}
@@ -1180,7 +1184,7 @@ file { "/tmp/yayness":
result = parser.newclass "Yayness"
end
assert_equal(result, parser.find_hostclass("", "yayNess"))
-
+
assert_nothing_raised do
result = parser.newdefine "FunTest"
end
diff --git a/test/language/scope.rb b/test/language/scope.rb
index 671af7130..8819de66e 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -395,6 +395,7 @@ Host <<||>>"
assert(flat.find{|o| o.name == name }, "Did not find #{name}")
end
}
+ ensure
Puppet[:storeconfigs] = false
Puppet::Resource::Catalog.cache_class = catalog_cache_class
Puppet::Node::Facts.cache_class = facts_cache_class