summaryrefslogtreecommitdiffstats
path: root/test/language/functions.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-01 17:41:00 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-01 17:41:00 +0000
commit1808c50ea15f48eab7110f34685fbb4c84b6a00a (patch)
treefdeb5ffacc8f790d7c437c3bb1a1200eea49aaab /test/language/functions.rb
parent521606bfa83ef3e9f02be846689cda3d759db607 (diff)
downloadpuppet-1808c50ea15f48eab7110f34685fbb4c84b6a00a.tar.gz
puppet-1808c50ea15f48eab7110f34685fbb4c84b6a00a.tar.xz
puppet-1808c50ea15f48eab7110f34685fbb4c84b6a00a.zip
Apparently the include function was not failing when it could not find asked-for classes. Now it does.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2250 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/functions.rb')
-rwxr-xr-xtest/language/functions.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/language/functions.rb b/test/language/functions.rb
index 1484a1312..e3ab1ca1e 100755
--- a/test/language/functions.rb
+++ b/test/language/functions.rb
@@ -415,6 +415,36 @@ class TestLangFunctions < Test::Unit::TestCase
assert(ffun, "Could not find definition in 'fun' namespace")
assert(ffoo, "Could not find definition in 'foo' namespace")
end
+
+ def test_include
+ interp = mkinterp
+ scope = mkscope(:interp => interp)
+
+ assert_raise(Puppet::ParseError, "did not throw error on missing class") do
+ scope.function_include("nosuchclass")
+ end
+
+ interp.newclass("myclass")
+
+ assert_nothing_raised do
+ scope.function_include "myclass"
+ end
+
+ assert(scope.classlist.include?("myclass"),
+ "class was not evaluated")
+
+ # Now try multiple classes at once
+ classes = %w{one two three}.each { |c| interp.newclass(c) }
+
+ assert_nothing_raised do
+ scope.function_include classes
+ end
+
+ classes.each do |c|
+ assert(scope.classlist.include?(c),
+ "class %s was not evaluated" % c)
+ end
+ end
end
# $Id$