mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
e2efe8e81d
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
38 lines
772 B
Ruby
38 lines
772 B
Ruby
require 'rubygems'
|
|
require 'minitest/autorun'
|
|
require 'rdoc/stats'
|
|
require 'rdoc/code_objects'
|
|
require 'rdoc/markup'
|
|
require 'rdoc/parser'
|
|
|
|
class TestRDocStats < MiniTest::Unit::TestCase
|
|
|
|
def setup
|
|
RDoc::TopLevel.reset
|
|
|
|
@s = RDoc::Stats.new 0
|
|
end
|
|
|
|
def test_report_constant_alias
|
|
tl = RDoc::TopLevel.new 'fake.rb'
|
|
mod = tl.add_module RDoc::NormalModule, 'M'
|
|
|
|
c = tl.add_class RDoc::NormalClass, 'C'
|
|
mod.add_constant c
|
|
|
|
ca = RDoc::Constant.new 'CA', nil, nil
|
|
ca.is_alias_for = c
|
|
|
|
tl.add_constant ca
|
|
|
|
RDoc::TopLevel.complete :public
|
|
|
|
report = @s.report
|
|
|
|
# TODO change this to refute match, aliases should be ignored as they are
|
|
# programmer convenience constructs
|
|
assert_match(/class Object/, report)
|
|
end
|
|
|
|
end
|
|
|