File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -477,7 +477,12 @@ def merge(class_module)
477477 document = document . merge other_document
478478
479479 @comment = RDoc ::Comment . from_document ( document )
480- @comment_location = document
480+
481+ @comment_location = if document . parts . first . is_a? ( RDoc ::Markup ::Document )
482+ document . parts . map { |doc | [ doc , doc . file ] }
483+ else
484+ [ [ document , document . file ] ]
485+ end
481486 end
482487
483488 cm = class_module
Original file line number Diff line number Diff line change @@ -655,8 +655,10 @@ def test_merge
655655 tl = @store . add_file 'one.rb'
656656 p1 = tl . add_class RDoc ::NormalClass , 'Parent'
657657 c1 = p1 . add_class RDoc ::NormalClass , 'Klass'
658+ c1 . add_comment 'comment1' , tl
658659
659660 c2 = RDoc ::NormalClass . new 'Klass'
661+ c2 . add_comment 'comment2' , tl
660662
661663 c2 . merge c1
662664
@@ -665,6 +667,10 @@ def test_merge
665667
666668 assert c1 . current_section , 'original current_section'
667669 assert c2 . current_section , 'merged current_section'
670+
671+ comment , location = c2 . comment_location . first
672+ assert_kind_of RDoc ::Markup ::Document , comment
673+ assert_equal tl . relative_name , location
668674 end
669675
670676 def test_merge_attributes
You can’t perform that action at this time.
0 commit comments