From e3ee594fdfa0e7a6d9de26c4307e217de866f462 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 18 Jul 2009 13:08:57 +0200 Subject: 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 --- spec/unit/parser/ast/function.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/unit/parser/ast/function.rb') 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 -- cgit