summaryrefslogtreecommitdiffstats
path: root/test/language/functions.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-18 06:01:18 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-18 06:01:18 +0000
commit3a6683ea720a53bd2ddb34b9215bdc676bdcdb2c (patch)
tree3865ab57a73d5b07554cda594eb9c5fff15b027a /test/language/functions.rb
parent05080ff50b73597f0a3f86242b63985a1e5e6003 (diff)
downloadpuppet-3a6683ea720a53bd2ddb34b9215bdc676bdcdb2c.tar.gz
puppet-3a6683ea720a53bd2ddb34b9215bdc676bdcdb2c.tar.xz
puppet-3a6683ea720a53bd2ddb34b9215bdc676bdcdb2c.zip
Changing the realize() function to be just syntactic sugar for a collection -- it literally creates a collector object now. The benefit of this is that it is late-binding, so file order does not affect whether a resource is available.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1810 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/functions.rb')
-rwxr-xr-xtest/language/functions.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/language/functions.rb b/test/language/functions.rb
index 21af606db..bd7143db6 100755
--- a/test/language/functions.rb
+++ b/test/language/functions.rb
@@ -321,19 +321,37 @@ class TestLangFunctions < Test::Unit::TestCase
@scope.function_realize(ref)
end
+ # Make sure it created a collection
+ assert_equal(1, @scope.collections.length,
+ "Did not set collection")
+
+ assert_nothing_raised do
+ @scope.collections.each do |coll| coll.evaluate end
+ end
+ @scope.collections.clear
+
# Now make sure the virtual resource is no longer virtual
assert(! virtual.virtual?, "Did not make virtual resource real")
# Make sure we puke on any resource that doesn't exist
-
none = Puppet::Parser::Resource::Reference.new(
:type => "file", :title => "/tmp/nosuchfile",
:scope => @scope
)
- assert_raise(Puppet::ParseError) do
+ # The function works
+ assert_nothing_raised do
@scope.function_realize(none)
end
+
+ # Make sure it created a collection
+ assert_equal(1, @scope.collections.length,
+ "Did not set collection")
+
+ # But the collection fails
+ assert_raise(Puppet::ParseError) do
+ @scope.collections.each do |coll| coll.evaluate end
+ end
end
end