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/function.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/function.rb')
-rw-r--r-- | spec/unit/parser/ast/function.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/parser/ast/function.rb b/spec/unit/parser/ast/function.rb index 15420132f..bb687eac0 100644 --- a/spec/unit/parser/ast/function.rb +++ b/spec/unit/parser/ast/function.rb @@ -16,6 +16,12 @@ describe Puppet::Parser::AST::Function do end end + it "should return its representation with to_s" do + args = stub 'args', :is_a? => true, :to_s => "[a, b]" + + Puppet::Parser::AST::Function.new(:name => "func", :arguments => args).to_s.should == "func(a, b)" + end + describe "when evaluating" do it "should fail if the function doesn't exist" do |