diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-25 00:15:08 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-25 00:15:08 +0000 |
commit | 2d579c00745e342db294a4a4afb547c85ceac05c (patch) | |
tree | 21a21fe9c9b7b053f6b91acef5e109f096cbee1a /test/rdoc/test_rdoc_store.rb | |
parent | f1ef3d600d5b0a8253dc5d6585f0607f2f23f515 (diff) | |
download | ruby-2d579c00745e342db294a4a4afb547c85ceac05c.tar.gz |
* lib/rdoc/generator/darkfish.rb: Fixed debug message. RDoc bug #174
by Thomas Leitner.
* lib/rdoc/store.rb: Fixed deletion of ri attribute data when a class
was loaded then saved. RDoc bug #171 by Thomas Leitner.
* test/rdoc/test_rdoc_store.rb: Test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_store.rb')
-rw-r--r-- | test/rdoc/test_rdoc_store.rb | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/test/rdoc/test_rdoc_store.rb b/test/rdoc/test_rdoc_store.rb index 7e18693803..3b92707987 100644 --- a/test/rdoc/test_rdoc_store.rb +++ b/test/rdoc/test_rdoc_store.rb @@ -778,6 +778,7 @@ class TestRDocStore < XrefTestCase @s.save_method @klass, @meth @s.save_method @klass, @meth_bang @s.save_method @klass, @cmeth + @s.save_method @klass, @attr @s.save_cache klass = RDoc::NormalClass.new 'Object' @@ -799,11 +800,15 @@ class TestRDocStore < XrefTestCase assert_cache({ 'Object' => %w[replace] }, {}, { 'Object' => %w[attr_accessor\ attr] }, %w[Object], - 'Object' => OBJECT_ANCESTORS) + 'Object' => OBJECT_ANCESTORS) - refute File.exist? @s.method_file(@klass.full_name, @meth.full_name) - refute File.exist? @s.method_file(@klass.full_name, @meth_bang.full_name) - refute File.exist? @s.method_file(@klass.full_name, @cmeth.full_name) + # assert these files were deleted + refute_file @s.method_file(@klass.full_name, @meth.full_name) + refute_file @s.method_file(@klass.full_name, @meth_bang.full_name) + refute_file @s.method_file(@klass.full_name, @cmeth.full_name) + + # assert these files were not deleted + assert_file @s.method_file(@klass.full_name, @attr.full_name) end def test_save_class_dry_run @@ -815,6 +820,40 @@ class TestRDocStore < XrefTestCase refute_file File.join(@tmpdir, 'Object', 'cdesc-Object.ri') end + def test_save_class_loaded + @s.save + + assert_directory File.join(@tmpdir, 'Object') + assert_file File.join(@tmpdir, 'Object', 'cdesc-Object.ri') + + assert_file @s.method_file(@klass.full_name, @attr.full_name) + assert_file @s.method_file(@klass.full_name, @cmeth.full_name) + assert_file @s.method_file(@klass.full_name, @meth.full_name) + assert_file @s.method_file(@klass.full_name, @meth_bang.full_name) + + s = RDoc::Store.new @s.path + s.load_cache + + loaded = s.load_class 'Object' + + assert_equal @klass, loaded + + s.save_class loaded + + s = RDoc::Store.new @s.path + s.load_cache + + reloaded = s.load_class 'Object' + + assert_equal @klass, reloaded + + # assert these files were not deleted. Bug #171 + assert_file s.method_file(@klass.full_name, @attr.full_name) + assert_file s.method_file(@klass.full_name, @cmeth.full_name) + assert_file s.method_file(@klass.full_name, @meth.full_name) + assert_file s.method_file(@klass.full_name, @meth_bang.full_name) + end + def test_save_class_merge @s.save_class @klass |