summaryrefslogtreecommitdiffstats
path: root/spec/integration/util/rdoc/parser.rb
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-12-28 16:47:57 +0100
committerJames Turnbull <james@lovedthanlost.net>2010-01-18 23:19:27 +1100
commitd31ff7ebee14f79b523c3fe4c974d4e6add47a2d (patch)
treef1d69605da24925099e8b8a940cec703f77263ae /spec/integration/util/rdoc/parser.rb
parenta9fb82b0026e75a670fec553b17de3b0f091c2a5 (diff)
downloadpuppet-d31ff7ebee14f79b523c3fe4c974d4e6add47a2d.tar.gz
puppet-d31ff7ebee14f79b523c3fe4c974d4e6add47a2d.tar.xz
puppet-d31ff7ebee14f79b523c3fe4c974d4e6add47a2d.zip
Adapt to method name change since 8971d8
When the definition/hostclass/node AST types were removed, the parentclass method was renamed to 'parent'. This patch fixes the incorrect rdoc usage (and some deeper integration test so that it won't happen again). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/integration/util/rdoc/parser.rb')
-rwxr-xr-xspec/integration/util/rdoc/parser.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/integration/util/rdoc/parser.rb b/spec/integration/util/rdoc/parser.rb
index 542660998..1dd36c699 100755
--- a/spec/integration/util/rdoc/parser.rb
+++ b/spec/integration/util/rdoc/parser.rb
@@ -35,8 +35,25 @@ describe RDoc::Parser do
File.unlink(@parsedfile)
end
+ def get_test_class(toplevel)
+ # toplevel -> main -> test
+ toplevel.classes[0].classes[0]
+ end
+
it "should parse to RDoc data structure" do
@parser.expects(:document_class).with { |n,k,c| n == "::test" and k.is_a?(Puppet::Parser::ResourceType) }
@parser.scan
end
+
+ it "should get a PuppetClass for the main class" do
+ @parser.scan.classes[0].should be_a RDoc::PuppetClass
+ end
+
+ it "should produce a PuppetClass whose name is test" do
+ get_test_class(@parser.scan).name.should == "test"
+ end
+
+ it "should produce a PuppetClass whose comment is 'comment'" do
+ get_test_class(@parser.scan).comment.should == "comment\n"
+ end
end