diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-29 21:17:31 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-29 21:17:31 +0000 |
commit | e75e7fcc9f90d41ae14019c0f3b5d5048badbb5a (patch) | |
tree | 3611123592f58ecbf7c0ff8d54b22b5fcdeb60f1 /test/rdoc/test_rdoc_class_module.rb | |
parent | 6f1ce28d624007f1d7688865a782c3ba4ad376a0 (diff) |
* lib/rdoc: Update to RDoc 3.8 which contains fixes for documentation
in trunk.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_class_module.rb')
-rw-r--r-- | test/rdoc/test_rdoc_class_module.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_class_module.rb b/test/rdoc/test_rdoc_class_module.rb index 1ac0eda298..7d32a91580 100644 --- a/test/rdoc/test_rdoc_class_module.rb +++ b/test/rdoc/test_rdoc_class_module.rb @@ -40,6 +40,17 @@ class TestRDocClassModule < XrefTestCase assert_equal "comment 1\n---\ncomment 2\n---\n* comment 3", cm.comment end + def test_add_comment_stopdoc + tl = RDoc::TopLevel.new 'file.rb' + + cm = RDoc::ClassModule.new 'Klass' + cm.stop_doc + + cm.add_comment '# comment 1', tl + + assert_empty cm.comment + end + def test_ancestors assert_equal [@parent], @child.ancestors end @@ -258,6 +269,33 @@ class TestRDocClassModule < XrefTestCase assert_equal expected, cm1.attributes.sort end + def test_merge_collections_drop + tl = RDoc::TopLevel.new 'file' + + cm1 = RDoc::ClassModule.new 'C' + cm1.record_location tl + + const = cm1.add_constant RDoc::Constant.new('CONST', nil, nil) + const.record_location tl + + cm2 = RDoc::ClassModule.new 'C' + cm2.record_location tl + + added = [] + removed = [] + + cm1.merge_collections cm1.constants, cm2.constants, cm2.in_files do |add, c| + if add then + added << c + else + removed << c + end + end + + assert_empty added + assert_equal [const], removed + end + def test_merge_comment tl1 = RDoc::TopLevel.new 'one.rb' tl2 = RDoc::TopLevel.new 'two.rb' |