@@ -9,19 +9,19 @@ def test_add_comment
9
9
tl3 = @store . add_file 'three.rb'
10
10
11
11
cm = RDoc ::ClassModule . new 'Klass'
12
- comment_tl1 = RDoc ::Comment . new ( '# comment 1' )
12
+ comment_tl1 = RDoc ::Comment . new ( '# comment 1' , @top_level , :ruby )
13
13
cm . add_comment comment_tl1 , tl1
14
14
15
15
assert_equal [ [ comment_tl1 , tl1 ] ] , cm . comment_location
16
16
assert_equal 'comment 1' , cm . comment . text
17
17
18
- comment_tl2 = RDoc ::Comment . new ( '# comment 2' )
18
+ comment_tl2 = RDoc ::Comment . new ( '# comment 2' , @top_level , :ruby )
19
19
cm . add_comment comment_tl2 , tl2
20
20
21
21
assert_equal [ [ comment_tl1 , tl1 ] , [ comment_tl2 , tl2 ] ] , cm . comment_location
22
22
assert_equal "comment 1\n ---\n comment 2" , cm . comment
23
23
24
- comment_tl3 = RDoc ::Comment . new ( '# * comment 3' )
24
+ comment_tl3 = RDoc ::Comment . new ( '# * comment 3' , @top_level , :ruby )
25
25
cm . add_comment comment_tl3 , tl3
26
26
27
27
assert_equal [ [ comment_tl1 , tl1 ] ,
@@ -42,11 +42,13 @@ def test_add_comment_duplicate
42
42
tl1 = @store . add_file 'one.rb'
43
43
44
44
cm = RDoc ::ClassModule . new 'Klass'
45
- cm . add_comment '# comment 1' , tl1
46
- cm . add_comment '# comment 2' , tl1
45
+ comment1 = RDoc ::Comment . new ( '# comment 1' , @top_level , :ruby )
46
+ comment2 = RDoc ::Comment . new ( '# comment 2' , @top_level , :ruby )
47
+ cm . add_comment comment1 , tl1
48
+ cm . add_comment comment2 , tl1
47
49
48
- assert_equal [ [ 'comment 1' , tl1 ] ,
49
- [ 'comment 2' , tl1 ] ] , cm . comment_location
50
+ assert_equal [ [ comment1 , tl1 ] ,
51
+ [ comment2 , tl1 ] ] , cm . comment_location
50
52
end
51
53
52
54
def test_add_comment_stopdoc
@@ -66,17 +68,17 @@ def test_ancestors
66
68
67
69
def test_comment_equals
68
70
cm = RDoc ::ClassModule . new 'Klass'
69
- cm . comment = '# comment 1'
71
+ cm . comment = RDoc :: Comment . new ( '# comment 1' , @top_level , :ruby )
70
72
71
- assert_equal 'comment 1' , cm . comment
73
+ assert_equal 'comment 1' , cm . comment . to_s
72
74
73
- cm . comment = '# comment 2'
75
+ cm . comment = RDoc :: Comment . new ( '# comment 2' , @top_level , :ruby )
74
76
75
- assert_equal "comment 1\n ---\n comment 2" , cm . comment
77
+ assert_equal "comment 1\n ---\n comment 2" , cm . comment . to_s
76
78
77
- cm . comment = " # * comment 3"
79
+ cm . comment = RDoc :: Comment . new ( ' # * comment 3' , @top_level , :ruby )
78
80
79
- assert_equal "comment 1\n ---\n comment 2\n ---\n * comment 3" , cm . comment
81
+ assert_equal "comment 1\n ---\n comment 2\n ---\n * comment 3" , cm . comment . to_s
80
82
end
81
83
82
84
def test_comment_equals_comment
0 commit comments