From 182ce60f7552ec62b1d97fbc3e701f9405b12291 Mon Sep 17 00:00:00 2001 From: drbrain Date: Wed, 12 Dec 2012 05:16:53 +0000 Subject: * lib/rdoc/class_module.rb: Added RDoc::ClassModule#documented? which checks comment_location. Hide RDoc::ClassModule#comment=. * test/rdoc/test_rdoc_class_module.rb: Test for above. * lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml: Fix display of the table of contents in the sidebar. * lib/rdoc/generator/template/darkfish/table_of_contents.rhtml: Use #comment_location when displaying classes or modules. * test/rdoc/test_rdoc_store.rb: Use comment_location. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rdoc/test_rdoc_class_module.rb | 22 ++++++++++++++++++++++ test/rdoc/test_rdoc_store.rb | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'test/rdoc') diff --git a/test/rdoc/test_rdoc_class_module.rb b/test/rdoc/test_rdoc_class_module.rb index a6aa1e9472..e5d855b2cd 100644 --- a/test/rdoc/test_rdoc_class_module.rb +++ b/test/rdoc/test_rdoc_class_module.rb @@ -95,6 +95,28 @@ class TestRDocClassModule < XrefTestCase refute @c1.document_self_or_methods end + def test_documented_eh + cm = RDoc::ClassModule.new 'C' + + refute cm.documented? + + cm.add_comment 'hi', @top_level + + assert cm.documented? + + cm.comment.replace '' + + assert cm.documented? + + cm.comment_location.clear + + refute cm.documented? + + cm.document_self = nil # notify :nodoc: + + assert cm.documented? + end + def test_each_ancestor assert_equal [@parent], @child.each_ancestor.to_a end diff --git a/test/rdoc/test_rdoc_store.rb b/test/rdoc/test_rdoc_store.rb index 1bf42bc92c..a5a5adec7b 100644 --- a/test/rdoc/test_rdoc_store.rb +++ b/test/rdoc/test_rdoc_store.rb @@ -708,7 +708,7 @@ class TestRDocStore < XrefTestCase document = @RM::Document.new inner - assert_equal document, s.load_class('Object').comment + assert_equal document, s.load_class('Object').comment_location end # This is a functional test -- cgit v1.2.3