diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 04:59:24 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 04:59:24 +0000 |
commit | b7528b5edb1f9148ea00ebb6151720e5943b3f0b (patch) | |
tree | 4caf55c53adb188170240f54b924892fbc5f9814 /test/rdoc/test_rdoc_top_level.rb | |
parent | 97ac172d58d695305c39d555155318edb99f1ea7 (diff) |
* lib/rdoc.rb: Import RDoc 3.7 release candidate
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_top_level.rb')
-rw-r--r-- | test/rdoc/test_rdoc_top_level.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_top_level.rb b/test/rdoc/test_rdoc_top_level.rb index 89f64247f9..6c1bc43e7a 100644 --- a/test/rdoc/test_rdoc_top_level.rb +++ b/test/rdoc/test_rdoc_top_level.rb @@ -81,6 +81,15 @@ class TestRDocTopLevel < XrefTestCase RDoc::TopLevel.modules.map { |m| m.full_name }.sort end + def test_class_new + tl1 = RDoc::TopLevel.new 'file.rb' + tl2 = RDoc::TopLevel.new 'file.rb' + tl3 = RDoc::TopLevel.new 'other.rb' + + assert_same tl1, tl2 + refute_same tl1, tl3 + end + def test_class_reset RDoc::TopLevel.reset @@ -93,6 +102,24 @@ class TestRDocTopLevel < XrefTestCase assert_equal 'top_level.rb', @top_level.base_name end + def test_eql_eh + top_level2 = RDoc::TopLevel.new 'path/top_level.rb' + other_level = RDoc::TopLevel.new 'path/other_level.rb' + + assert_operator @top_level, :eql?, top_level2 + + refute_operator other_level, :eql?, @top_level + end + + def test_equals2 + top_level2 = RDoc::TopLevel.new 'path/top_level.rb' + other_level = RDoc::TopLevel.new 'path/other_level.rb' + + assert_equal @top_level, top_level2 + + refute_equal other_level, @top_level + end + def test_find_class_or_module assert_equal @c1, @xref_data.find_class_or_module('C1') assert_equal @c2_c3, @xref_data.find_class_or_module('C2::C3') @@ -104,6 +131,14 @@ class TestRDocTopLevel < XrefTestCase assert_equal 'path/top_level.rb', @top_level.full_name end + def test_hash + tl2 = RDoc::TopLevel.new 'path/top_level.rb' + tl3 = RDoc::TopLevel.new 'other/top_level.rb' + + assert_equal @top_level.hash, tl2.hash + refute_equal @top_level.hash, tl3.hash + end + def test_http_url assert_equal 'prefix/path/top_level_rb.html', @top_level.http_url('prefix') end |