From d95b687045920c7d7fed5da1fe03b0feac86327a Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Thu, 23 Jul 2009 23:09:34 +0200 Subject: Fix #2439 - let puppetdoc use loaded_code Since there isn't any unit test for puppetdoc rdoc code (my fault), nobody noticed it was using direct access to the parser AST array. This changeset fixes the way puppetdoc uses the parser results. Signed-off-by: Brice Figureau --- spec/unit/parser/loaded_code.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/unit/parser/loaded_code.rb') diff --git a/spec/unit/parser/loaded_code.rb b/spec/unit/parser/loaded_code.rb index 50f6b930c..d2986bf2c 100644 --- a/spec/unit/parser/loaded_code.rb +++ b/spec/unit/parser/loaded_code.rb @@ -25,6 +25,13 @@ describe Puppet::Parser::LoadedCode do it "should return nil when asked for a #{data} that has not been added" do Puppet::Parser::LoadedCode.new.send(data, "foo").should be_nil end + + it "should be able to retrieve all #{data}s" do + plurals = { "hostclass" => "hostclasses", "node" => "nodes", "definition" => "definitions" } + loader = Puppet::Parser::LoadedCode.new + loader.send("add_" + data , "foo", "bar") + loader.send(plurals[data]).should == { "foo" => "bar" } + end end describe "when finding a qualified instance" do -- cgit