Skip to content

Commit 73dded6

Browse files
committed
Add tests for @a883e14
This was imported from trunk but no tests were added. Now we have some nice tests to prevent regeressions. Fixes #270
1 parent 17dd1fc commit 73dded6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/test_rdoc_constant.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@ def setup
88
@const = @c1.constants.first
99
end
1010

11+
def test_documented_eh
12+
top_level = @store.add_file 'file.rb'
13+
14+
const = RDoc::Constant.new 'CONST', nil, nil
15+
top_level.add_constant const
16+
17+
refute const.documented?
18+
19+
const.comment = comment 'comment'
20+
21+
assert const.documented?
22+
end
23+
24+
def test_documented_eh_alias
25+
top_level = @store.add_file 'file.rb'
26+
27+
const = RDoc::Constant.new 'CONST', nil, nil
28+
top_level.add_constant const
29+
30+
refute const.documented?
31+
32+
const.is_alias_for = 'C1'
33+
34+
refute const.documented?
35+
36+
@c1.add_comment comment('comment'), @top_level
37+
38+
assert const.documented?
39+
end
40+
1141
def test_full_name
1242
assert_equal 'C1::CONST', @const.full_name
1343
end

0 commit comments

Comments
 (0)