mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
90d5bcf910
commit
e2efe8e81d
28 changed files with 494 additions and 56 deletions
38
test/rdoc/test_rdoc_stats.rb
Normal file
38
test/rdoc/test_rdoc_stats.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue