diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-07-18 13:08:57 +0200 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-07-25 20:13:58 +1000 |
| commit | e3ee594fdfa0e7a6d9de26c4307e217de866f462 (patch) | |
| tree | 315177df89205b1747fb506edc543175ebf032f0 /spec/unit/parser/ast/astarray.rb | |
| parent | b3b76dffdd9cd8ed5c3d0230624bf05015bec5b8 (diff) | |
| download | puppet-e3ee594fdfa0e7a6d9de26c4307e217de866f462.tar.gz puppet-e3ee594fdfa0e7a6d9de26c4307e217de866f462.tar.xz puppet-e3ee594fdfa0e7a6d9de26c4307e217de866f462.zip | |
Fix #2422 & #2433 - make sure puppetdoc transform AST::Leaf boolean correctly
AST nodes don't have a valid to_s that is producing a correct
representation of said node.
This patch adds some of the AST node to_s to produce correct
values that can be used verbatim by puppetdoc to render
the documentation.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/parser/ast/astarray.rb')
| -rwxr-xr-x | spec/unit/parser/ast/astarray.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/parser/ast/astarray.rb b/spec/unit/parser/ast/astarray.rb index 212c3fd14..1791c711c 100755 --- a/spec/unit/parser/ast/astarray.rb +++ b/spec/unit/parser/ast/astarray.rb @@ -62,5 +62,11 @@ describe Puppet::Parser::AST::ASTArray do operator.evaluate(@scope).should == [[123]] end + it "should return a valid string with to_s" do + a = stub 'a', :is_a? => true, :to_s => "a" + b = stub 'b', :is_a? => true, :to_s => "b" + array = Puppet::Parser::AST::ASTArray.new :children => [a,b] + array.to_s.should == "[a, b]" + end end |
