From e2efe8e81dc7e9fce40b024df6a20bbf4b830350 Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 28 Dec 2010 22:08:56 +0000 Subject: Import RDoc 3.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rdoc/test_rdoc_stats.rb | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/rdoc/test_rdoc_stats.rb (limited to 'test/rdoc/test_rdoc_stats.rb') diff --git a/test/rdoc/test_rdoc_stats.rb b/test/rdoc/test_rdoc_stats.rb new file mode 100644 index 0000000000..0032c75669 --- /dev/null +++ b/test/rdoc/test_rdoc_stats.rb @@ -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 + -- cgit v1.2.3