diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-08 14:25:52 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-08 14:25:52 -0600 |
commit | 5a0e34b4f8da22e1830ec7d0a730c3686665bceb (patch) | |
tree | d8635f754c2a0fee69e103cf6d85792ff4e736a1 /test/language/functions.rb | |
parent | 82720d5327b30839a29035ee0b498b940ffc7a5a (diff) | |
download | puppet-5a0e34b4f8da22e1830ec7d0a730c3686665bceb.tar.gz puppet-5a0e34b4f8da22e1830ec7d0a730c3686665bceb.tar.xz puppet-5a0e34b4f8da22e1830ec7d0a730c3686665bceb.zip |
Refactoring the AST classes just a bit. I realized that
all of the evaluate() methods only ever accepted a scope,
and sometimes one other option, so I switched them all to
use named arguments instead of a hash.
Diffstat (limited to 'test/language/functions.rb')
-rwxr-xr-x | test/language/functions.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/language/functions.rb b/test/language/functions.rb index 132ee97ac..edb39e9a7 100755 --- a/test/language/functions.rb +++ b/test/language/functions.rb @@ -41,7 +41,7 @@ class TestLangFunctions < Test::Unit::TestCase scope = mkscope val = nil assert_nothing_raised do - val = func.evaluate(:scope => scope) + val = func.evaluate(scope) end assert_equal("output avalue", val) @@ -57,7 +57,7 @@ class TestLangFunctions < Test::Unit::TestCase val = nil assert_nothing_raised do - val = func.evaluate(:scope => scope) + val = func.evaluate(scope) end assert_equal(retval, val, "'tagged' returned %s for %s" % [val, tag]) @@ -86,7 +86,7 @@ class TestLangFunctions < Test::Unit::TestCase scope = mkscope val = nil assert_raise(Puppet::ParseError) do - val = func.evaluate(:scope => scope) + val = func.evaluate(scope) end end @@ -117,16 +117,16 @@ class TestLangFunctions < Test::Unit::TestCase scope = mkscope assert_raise(Puppet::ParseError) do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end scope.setvar("one", "One") assert_raise(Puppet::ParseError) do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end scope.setvar("two", "Two") assert_nothing_raised do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end assert_equal("template One\ntemplate Two\n", scope.lookupvar("output"), @@ -155,13 +155,13 @@ class TestLangFunctions < Test::Unit::TestCase scope = mkscope assert_raise(Puppet::ParseError) do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end scope.setvar("yayness", "this is yayness") assert_nothing_raised do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end assert_equal("template this is yayness\n", scope.lookupvar("output"), @@ -191,7 +191,7 @@ class TestLangFunctions < Test::Unit::TestCase scope = mkscope scope.setvar("myvar", "this is yayness") assert_raise(Puppet::ParseError) do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end end @@ -264,14 +264,14 @@ class TestLangFunctions < Test::Unit::TestCase }.each do |string, value| scope = mkscope assert_raise(Puppet::ParseError) do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end scope.setvar("yayness", string) assert_equal(string, scope.lookupvar("yayness", false)) assert_nothing_raised("An empty string was not a valid variable value") do - ast.evaluate(:scope => scope) + ast.evaluate(scope) end assert_equal("template #{value}\n", scope.lookupvar("output"), |