1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/rdoc/test_rdoc_stats.rb
drbrain e2efe8e81d Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-28 22:08:56 +00:00

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