summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-09-09 16:20:26 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-09-09 16:20:26 -0700
commit6860594c4d95855d5106fbf664a473e1ac4d3935 (patch)
tree89ccd167744440199647c924be6ffa28eb7fb41a /test
parentf62095749a14fd67987df5cf2e3e9138b71efd19 (diff)
parentdf088c9ba16dce50c17a79920c1ac186db67b9e9 (diff)
downloadpuppet-6860594c4d95855d5106fbf664a473e1ac4d3935.tar.gz
puppet-6860594c4d95855d5106fbf664a473e1ac4d3935.tar.xz
puppet-6860594c4d95855d5106fbf664a473e1ac4d3935.zip
Merge remote branch 'paul/ticket/next/4638' into next
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/parser.rb6
-rw-r--r--test/lib/puppettest/parsertesting.rb13
2 files changed, 9 insertions, 10 deletions
diff --git a/test/language/parser.rb b/test/language/parser.rb
index 6599757f0..6f3d751c2 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -477,9 +477,11 @@ file { "/tmp/yayness":
end
assert_instance_of(AST::ASTArray, ret.hostclass("").code)
- resdef = ret.hostclass("").code[0][0]
+ resdef = ret.hostclass("").code[0]
assert_instance_of(AST::Resource, resdef)
- assert_equal("/tmp/testing", resdef.title.value)
+ assert_instance_of(AST::ASTArray, resdef.instances)
+ assert_equal(1, resdef.instances.children.length)
+ assert_equal("/tmp/testing", resdef.instances[0].title.value)
# We always get an astarray back, so...
check.call(resdef, "simple resource")
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb
index bd04c1ec5..411bad37a 100644
--- a/test/lib/puppettest/parsertesting.rb
+++ b/test/lib/puppettest/parsertesting.rb
@@ -94,16 +94,15 @@ module PuppetTest::ParserTesting
def resourcedef(type, title, params)
title = stringobj(title) unless title.is_a?(AST)
+ instance = AST::ResourceInstance.new(:title => title, :parameters => resourceparams(params))
assert_nothing_raised("Could not create #{type} #{title}") {
return AST::Resource.new(
:file => __FILE__,
:line => __LINE__,
- :title => title,
:type => type,
-
- :parameters => resourceinst(params)
+ :instances => AST::ASTArray.new(:children => [instance])
)
}
end
@@ -122,9 +121,7 @@ module PuppetTest::ParserTesting
:file => __FILE__,
:line => __LINE__,
:object => resourceref(type, title),
-
- :type => type,
- :parameters => resourceinst(params)
+ :parameters => resourceparams(params)
)
}
end
@@ -197,13 +194,13 @@ module PuppetTest::ParserTesting
}
end
- def resourceinst(hash)
+ def resourceparams(hash)
assert_nothing_raised("Could not create resource instance") {
params = hash.collect { |param, value|
resourceparam(param, value)
}
- return AST::ResourceInstance.new(
+ return AST::ASTArray.new(
:file => tempfile,