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/parser.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/parser.rb')
-rwxr-xr-x | test/language/parser.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/language/parser.rb b/test/language/parser.rb index 1bbd894e4..3df4d0bb8 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -47,7 +47,7 @@ class TestParser < Test::Unit::TestCase ast = parser.parse config = mkcompile(parser) config.compile - #ast.classes[""].evaluate :scope => config.topscope + #ast.classes[""].evaluate config.topscope } Puppet::Type.allclear } @@ -891,7 +891,7 @@ file { "/tmp/yayness": assert(parser.classes["myclass"], "Could not find definition") assert_equal("myclass", parser.classes["myclass"].classname) assert_equal(%w{original code}, - parser.classes["myclass"].code.evaluate(:scope => scope)) + parser.classes["myclass"].code.evaluate(scope)) # Newclass behaves differently than the others -- it just appends # the code to the existing class. @@ -901,7 +901,7 @@ file { "/tmp/yayness": end assert(klass, "Did not return class when appending") assert_equal(%w{original code something new}, - parser.classes["myclass"].code.evaluate(:scope => scope)) + parser.classes["myclass"].code.evaluate(scope)) # Now create the same class name in a different scope assert_nothing_raised { @@ -914,7 +914,7 @@ file { "/tmp/yayness": assert_equal("other::myclass", other.classname) assert_equal("other::myclass", other.namespace) assert_equal(%w{something diff}, - other.code.evaluate(:scope => scope)) + other.code.evaluate(scope)) # Make sure newclass deals correctly with nodes with no code klass = parser.newclass("nocode") @@ -925,7 +925,7 @@ file { "/tmp/yayness": end assert(klass, "Did not return class with no code") assert_equal(%w{yay test}, - parser.classes["nocode"].code.evaluate(:scope => scope)) + parser.classes["nocode"].code.evaluate(scope)) # Then try merging something into nothing parser.newclass("nocode2", :code => mkcode.call(%w{foo test})) @@ -936,7 +936,7 @@ file { "/tmp/yayness": end assert(klass, "Did not return class with no code") assert_equal(%w{foo test}, - parser.classes["nocode2"].code.evaluate(:scope => scope)) + parser.classes["nocode2"].code.evaluate(scope)) # And lastly, nothing and nothing klass = parser.newclass("nocode3") |