summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_store.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-26 05:56:26 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-26 05:56:26 +0000
commit98c7058bf7b3eab91c62a77cb10b09f6c8ed368e (patch)
treea90e594c950a1e3160a69f90a9e6215242937ef7 /test/rdoc/test_rdoc_store.rb
parentee83dc3fe49ac23321a055a2a4b337499d2494eb (diff)
Merge RDoc 6.0.3 from upstream.
It fixed the several bugs that was found after RDoc 6 releasing. From: SHIBATA Hiroshi <hsbt@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_store.rb')
-rw-r--r--test/rdoc/test_rdoc_store.rb32
1 files changed, 21 insertions, 11 deletions
diff --git a/test/rdoc/test_rdoc_store.rb b/test/rdoc/test_rdoc_store.rb
index 4a4cf3ac0f..4246b4cbbf 100644
--- a/test/rdoc/test_rdoc_store.rb
+++ b/test/rdoc/test_rdoc_store.rb
@@ -162,7 +162,7 @@ class TestRDocStore < XrefTestCase
def test_all_classes_and_modules
expected = %w[
- C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 C6 C7
+ C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 C6 C7 C8 C8::S1
Child
M1 M1::M2
Parent
@@ -213,7 +213,7 @@ class TestRDocStore < XrefTestCase
def test_classes
expected = %w[
- C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 C6 C7
+ C1 C2 C2::C3 C2::C3::H1 C3 C3::H1 C3::H2 C4 C4::C4 C5 C5::C1 C6 C7 C8 C8::S1
Child
Parent
]
@@ -222,7 +222,8 @@ class TestRDocStore < XrefTestCase
end
def test_complete
- @c2.add_module_alias @c2_c3, 'A1', @top_level
+ a1 = RDoc::Constant.new 'A1', '', ''
+ @c2.add_module_alias @c2_c3, @c2_c3.name, a1, @top_level
@store.complete :public
@@ -407,7 +408,7 @@ class TestRDocStore < XrefTestCase
Dir.mkdir @tmpdir
- open File.join(@tmpdir, 'cache.ri'), 'wb' do |io|
+ File.open File.join(@tmpdir, 'cache.ri'), 'wb' do |io|
Marshal.dump cache, io
end
@@ -441,7 +442,7 @@ class TestRDocStore < XrefTestCase
Dir.mkdir @tmpdir
- open File.join(@tmpdir, 'cache.ri'), 'wb' do |io|
+ File.open File.join(@tmpdir, 'cache.ri'), 'wb' do |io|
Marshal.dump cache, io
end
@@ -490,7 +491,7 @@ class TestRDocStore < XrefTestCase
Dir.mkdir @tmpdir
- open File.join(@tmpdir, 'cache.ri'), 'wb' do |io|
+ File.open File.join(@tmpdir, 'cache.ri'), 'wb' do |io|
Marshal.dump cache, io
end
@@ -524,6 +525,15 @@ class TestRDocStore < XrefTestCase
assert_includes @s.classes_hash, 'Object'
end
+ def test_load_single_class
+ @s.save_class @c8_s1
+ @s.classes_hash.clear
+
+ assert_equal @c8_s1, @s.load_class('C8::S1')
+
+ assert_includes @s.classes_hash, 'C8::S1'
+ end
+
def test_load_method
@s.save_method @klass, @meth_bang
@@ -538,7 +548,7 @@ class TestRDocStore < XrefTestCase
file = @s.method_file @klass.full_name, @meth.full_name
- open file, 'wb' do |io|
+ File.open file, 'wb' do |io|
io.write "\x04\bU:\x14RDoc::AnyMethod[\x0Fi\x00I" +
"\"\vmethod\x06:\x06EF\"\x11Klass#method0:\vpublic" +
"o:\eRDoc::Markup::Document\x06:\v@parts[\x06" +
@@ -563,7 +573,7 @@ class TestRDocStore < XrefTestCase
end
def test_main
- assert_equal nil, @s.main
+ assert_nil @s.main
@s.main = 'README.txt'
@@ -633,7 +643,7 @@ class TestRDocStore < XrefTestCase
expected[:ancestors]['Object'] = %w[BasicObject]
- open File.join(@tmpdir, 'cache.ri'), 'rb' do |io|
+ File.open File.join(@tmpdir, 'cache.ri'), 'rb' do |io|
cache = Marshal.load io.read
assert_equal expected, cache
@@ -701,7 +711,7 @@ class TestRDocStore < XrefTestCase
expected[:ancestors]['Object'] = %w[BasicObject]
- open File.join(@tmpdir, 'cache.ri'), 'rb' do |io|
+ File.open File.join(@tmpdir, 'cache.ri'), 'rb' do |io|
cache = Marshal.load io.read
assert_equal expected, cache
@@ -981,7 +991,7 @@ class TestRDocStore < XrefTestCase
end
def test_title
- assert_equal nil, @s.title
+ assert_nil @s.title
@s.title = 'rdoc'