Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/rdoc/stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,16 @@ def undoc_params(method)

return 0, [] if params.empty?

document = parse method.comment
comment = method.comment

if comment.empty?
# An alias, or a method with a #see target, carries no comment of its
# own but inherits the documentation RDoc::MethodAttr#documented? uses.
inherited = method.is_alias_for || method.see
comment = inherited.comment if inherited
end

document = parse comment

tts = document.accept @formatter

Expand Down
15 changes: 15 additions & 0 deletions test/rdoc/rdoc_stats_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,21 @@ def test_undoc_params
assert_equal %w[a], undoc
end

def test_undoc_params_alias
method = RDoc::AnyMethod.new 'm'
method.params = '(a)'
method.comment = comment '+a+'

aliased = RDoc::AnyMethod.new 'n'
aliased.params = '(a)'
aliased.is_alias_for = method

total, undoc = @s.undoc_params aliased

assert_equal 1, total
assert_empty undoc
end

def test_undoc_params_block
method = RDoc::AnyMethod.new 'm'
method.params = '(&a)'
Expand Down