diff options
author | Luke Kanies <luke@reductivelabs.com> | 2010-02-06 11:34:16 -0800 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 0d704686b923c7827b9fe16f20d4f8722c125d88 (patch) | |
tree | bc410cb6b30e8f56b6a8abae93ee8e195febb485 /test/language/ast.rb | |
parent | ad93d0e442d4e4eff69bb3f444b2eee70a95dfa8 (diff) | |
download | puppet-0d704686b923c7827b9fe16f20d4f8722c125d88.tar.gz puppet-0d704686b923c7827b9fe16f20d4f8722c125d88.tar.xz puppet-0d704686b923c7827b9fe16f20d4f8722c125d88.zip |
Finishing renaming :params to :parameters internally
I had only done this partway, because it seemed easier,
but not surprisingly, it ended up being more complex.
In addition to those renames, this commit includes fixes
to whatever tests I needed to fix to confirm that things
were again working. I think most of these broken
tests have been broken for a while.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'test/language/ast.rb')
-rwxr-xr-x | test/language/ast.rb | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/test/language/ast.rb b/test/language/ast.rb index 916c34d45..a4d4d8773 100755 --- a/test/language/ast.rb +++ b/test/language/ast.rb @@ -6,12 +6,10 @@ require 'puppettest' require 'puppet/parser/parser' require 'puppettest/resourcetesting' require 'puppettest/parsertesting' -require 'puppettest/support/collection' class TestAST < Test::Unit::TestCase include PuppetTest::ParserTesting include PuppetTest::ResourceTesting - include PuppetTest::Support::Collection def test_if scope = mkscope @@ -56,41 +54,13 @@ class TestAST < Test::Unit::TestCase ref = resourceoverride("file", "/yayness", "owner" => "blah", "group" => "boo") end - Puppet::Parser::Resource.expects(:new).with { |type, title, o| o.is_a?(Hash) }.returns(:override) - scope.compiler.expects(:add_override).with(:override) + scope.compiler.expects(:add_override).with { |res| res.is_a?(Puppet::Parser::Resource) } ret = nil assert_nothing_raised do ret = ref.evaluate scope end - assert_equal(:override, ret, "Did not return override") - end - - # make sure our resourcedefaults ast object works correctly. - def test_resourcedefaults - scope = mkscope - - # Now make some defaults for files - args = {:source => "/yay/ness", :group => "yayness"} - assert_nothing_raised do - obj = defaultobj "file", args - obj.evaluate scope - end - - hash = nil - assert_nothing_raised do - hash = scope.lookupdefaults("File") - end - - hash.each do |name, value| - assert_instance_of(Symbol, name) # params always convert - assert_instance_of(Puppet::Parser::Resource::Param, value) - end - - args.each do |name, value| - assert(hash[name], "Did not get default %s" % name) - assert_equal(value, hash[name].value) - end + assert_instance_of(Puppet::Parser::Resource, ret, "Did not return override") end def test_collection @@ -114,25 +84,4 @@ class TestAST < Test::Unit::TestCase colls = scope.compiler.instance_variable_get("@collections") assert_equal([ret], colls, "Did not store collector in config's collection list") end - - def test_virtual_collexp - scope = mkscope - - # make a resource - resource = mkresource(:type => "file", :title => "/tmp/testing", - :scope => scope, :params => {:owner => "root", :group => "bin", :mode => "644"}) - - run_collection_queries(:virtual) do |string, result, query| - code = nil - assert_nothing_raised do - str, code = query.evaluate scope - end - - assert_instance_of(Proc, code) - assert_nothing_raised do - assert_equal(result, code.call(resource), - "'#{string}' failed") - end - end - end end |