diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-04-12 13:13:30 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-04-12 13:13:30 -0700 |
| commit | 2dfa0afb57ec80f451a54ef96341d413819c14c7 (patch) | |
| tree | 228ce122f952d72b513562a1874f93624ce855fb /test | |
| parent | 665fabdb3e468d1ef38d689b9cb0d75b9d788f88 (diff) | |
| parent | e569f3baec68b9f53b37ac07984b7a858b155991 (diff) | |
| download | puppet-2dfa0afb57ec80f451a54ef96341d413819c14c7.tar.gz puppet-2dfa0afb57ec80f451a54ef96341d413819c14c7.tar.xz puppet-2dfa0afb57ec80f451a54ef96341d413819c14c7.zip | |
Merge branch 'ticket/next/5027' into next
Diffstat (limited to 'test')
| -rwxr-xr-x | test/language/functions.rb | 10 | ||||
| -rwxr-xr-x | test/language/scope.rb | 23 |
2 files changed, 10 insertions, 23 deletions
diff --git a/test/language/functions.rb b/test/language/functions.rb index e882b68f3..84b1b3861 100755 --- a/test/language/functions.rb +++ b/test/language/functions.rb @@ -382,17 +382,15 @@ class TestLangFunctions < Test::Unit::TestCase }.each do |string, value| scope = mkscope scope.setvar("yayness", string) - assert_equal(string, scope.lookupvar("yayness", false)) + assert_equal(string, scope.lookupvar("yayness")) assert_nothing_raised("An empty string was not a valid variable value") do ast.evaluate(scope) end - - assert_equal( - "template #{value}\n", scope.lookupvar("output"), - - "#{string.inspect} did not get evaluated correctly") + assert_equal( + "template #{value}\n", scope.lookupvar("output"), + "#{string.inspect} did not get evaluated correctly") end end diff --git a/test/language/scope.rb b/test/language/scope.rb index c4154dc27..ccc359651 100755 --- a/test/language/scope.rb +++ b/test/language/scope.rb @@ -42,22 +42,22 @@ class TestScope < Test::Unit::TestCase # Set a variable in the top and make sure all three can get it topscope.setvar("first", "topval") scopes.each do |name, scope| - assert_equal("topval", scope.lookupvar("first", false), "Could not find var in #{name}") + assert_equal("topval", scope.lookupvar("first"), "Could not find var in #{name}") end # Now set a var in the midscope and make sure the mid and bottom can see it but not the top midscope.setvar("second", "midval") - assert_equal(:undefined, scopes[:top].lookupvar("second", false), "Found child var in top scope") + assert_equal(:undefined, scopes[:top].lookupvar("second"), "Found child var in top scope") [:mid, :bot].each do |name| - assert_equal("midval", scopes[name].lookupvar("second", false), "Could not find var in #{name}") + assert_equal("midval", scopes[name].lookupvar("second"), "Could not find var in #{name}") end # And set something in the bottom, and make sure we only find it there. botscope.setvar("third", "botval") [:top, :mid].each do |name| - assert_equal(:undefined, scopes[name].lookupvar("third", false), "Found child var in top scope") + assert_equal(:undefined, scopes[name].lookupvar("third"), "Found child var in top scope") end - assert_equal("botval", scopes[:bot].lookupvar("third", false), "Could not find var in bottom scope") + assert_equal("botval", scopes[:bot].lookupvar("third"), "Could not find var in bottom scope") # Test that the scopes convert to hash structures correctly. @@ -260,18 +260,7 @@ Host <<||>>" scope = mkscope scope.setvar("testing", :undef) - - - assert_equal( - :undef, scope.lookupvar("testing", false), - - "undef was not returned as :undef when not string") - - - assert_equal( - "", scope.lookupvar("testing", true), - - "undef was not returned as '' when string") + assert_equal(:undef, scope.lookupvar("testing"), "undef was not returned as :undef") end end |
