summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/functions.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/language/functions.rb b/test/language/functions.rb
index ee8f33c59..ae4b115ea 100755
--- a/test/language/functions.rb
+++ b/test/language/functions.rb
@@ -167,6 +167,32 @@ class TestLangFunctions < Test::Unit::TestCase
"Templates were not handled correctly")
end
+
+ def test_tempatefunction_cannot_see_scopes
+ template = tempfile()
+
+ File.open(template, "w") do |f|
+ f.puts "<%= lookupvar('myvar') %>"
+ end
+
+ func = nil
+ assert_nothing_raised do
+ func = Puppet::Parser::AST::Function.new(
+ :name => "template",
+ :ftype => :rvalue,
+ :arguments => AST::ASTArray.new(
+ :children => [stringobj(template)]
+ )
+ )
+ end
+ ast = varobj("output", func)
+
+ scope = Puppet::Parser::Scope.new()
+ scope.setvar("myvar", "this is yayness")
+ assert_raise(Puppet::ParseError) do
+ ast.evaluate(:scope => scope)
+ end
+ end
end
# $Id$