diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-10-04 16:31:30 -0700 |
---|---|---|
committer | Jesse Wolfe <jes5199@gmail.com> | 2010-10-04 21:46:49 -0700 |
commit | 163ec172e06a2b8aab9f9c9247dd45bc0dea3f72 (patch) | |
tree | a5534dcd95a260d134a3e746efaab447a30ba847 /spec/unit/util/rdoc/parser_spec.rb | |
parent | c9592f048331d7728d42f55cb29f5748ec9b1a67 (diff) | |
parent | 574812ef00e6681fce88bd1e66bbc07e7ade4b41 (diff) | |
download | puppet-163ec172e06a2b8aab9f9c9247dd45bc0dea3f72.tar.gz puppet-163ec172e06a2b8aab9f9c9247dd45bc0dea3f72.tar.xz puppet-163ec172e06a2b8aab9f9c9247dd45bc0dea3f72.zip |
Partial merge to 2.6.2rc1 : Merge commit '574812e' into next
The API for AST objects has changed, making the initialization of this
spec somewhat more complicated.
Also, git seems to have been confused by whitespace changes.
Manually Resolved Conflicts:
lib/puppet/parser/ast/resource.rb
Diffstat (limited to 'spec/unit/util/rdoc/parser_spec.rb')
-rwxr-xr-x | spec/unit/util/rdoc/parser_spec.rb | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb index 7809c75a3..04713f293 100755 --- a/spec/unit/util/rdoc/parser_spec.rb +++ b/spec/unit/util/rdoc/parser_spec.rb @@ -342,10 +342,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 @@ -379,10 +381,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 @@ -434,11 +437,16 @@ 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", + :instances => Puppet::Parser::AST::ASTArray.new(:children => [ + Puppet::Parser::AST::ResourceInstance.new( + :title => Puppet::Parser::AST::Name.new(:value => "myfile"), + :parameters => Puppet::Parser::AST::ASTArray.new(:children => []) + ) + ]), + :doc => 'mydoc' + ) @code = stub_everything 'code' @code.stubs(:is_a?).with(Puppet::Parser::AST::ASTArray).returns(true) |