summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/parser/ast/resource.rb6
-rwxr-xr-xspec/unit/util/rdoc/parser_spec.rb30
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/puppet/parser/ast/resource.rb b/lib/puppet/parser/ast/resource.rb
index 0c58538d5..6909c85c2 100644
--- a/lib/puppet/parser/ast/resource.rb
+++ b/lib/puppet/parser/ast/resource.rb
@@ -46,7 +46,6 @@ class Resource < AST::ResourceReference
:virtual => virt,
:source => scope.source,
:scope => scope,
-
:strict => true
)
@@ -64,12 +63,9 @@ class Resource < AST::ResourceReference
if params.is_a?(AST::ASTArray)
@parameters = params
else
-
- @parameters = AST::ASTArray.new(
-
+ @parameters = AST::ASTArray.new(
:line => params.line,
:file => params.file,
-
:children => [params]
)
end
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb
index 3614c0a3c..28c33c295 100755
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@ -340,10 +340,12 @@ describe RDoc::Parser do
def create_stmt(name)
stmt_value = stub "#{name}_value", :value => "myclass"
- stmt = stub_everything 'stmt', :name => name, :arguments => [stmt_value], :doc => "mydoc"
- stmt.stubs(:is_a?).with(Puppet::Parser::AST::ASTArray).returns(false)
- stmt.stubs(:is_a?).with(Puppet::Parser::AST::Function).returns(true)
- stmt
+
+ Puppet::Parser::AST::Function.new(
+ :name => name,
+ :arguments => [stmt_value],
+ :doc => 'mydoc'
+ )
end
before(:each) do
@@ -377,10 +379,11 @@ describe RDoc::Parser do
def create_stmt
stmt_value = stub "resource_ref", :to_s => "File[\"/tmp/a\"]"
- stmt = stub_everything 'stmt', :name => "realize", :arguments => [stmt_value], :doc => "mydoc"
- stmt.stubs(:is_a?).with(Puppet::Parser::AST::ASTArray).returns(false)
- stmt.stubs(:is_a?).with(Puppet::Parser::AST::Function).returns(true)
- stmt
+ Puppet::Parser::AST::Function.new(
+ :name => 'realize',
+ :arguments => [stmt_value],
+ :doc => 'mydoc'
+ )
end
before(:each) do
@@ -432,11 +435,12 @@ describe RDoc::Parser do
describe "when scanning for resources" do
before :each do
@class = stub_everything 'class'
-
- param = stub 'params', :children => []
- @stmt = stub_everything 'stmt', :type => "File", :title => "myfile", :doc => "mydoc", :params => param
- @stmt.stubs(:is_a?).with(Puppet::Parser::AST::ASTArray).returns(false)
- @stmt.stubs(:is_a?).with(Puppet::Parser::AST::Resource).returns(true)
+ @stmt = Puppet::Parser::AST::Resource.new(
+ :type => "File",
+ :title => "myfile",
+ :doc => 'mydoc',
+ :parameters => Puppet::Parser::AST::ASTArray.new(:children => [])
+ )
@code = stub_everything 'code'
@code.stubs(:is_a?).with(Puppet::Parser::AST::ASTArray).returns(true)