mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(21b241a)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
02dade3b9e
commit
80325bab52
8 changed files with 55 additions and 5 deletions
|
@ -156,6 +156,33 @@ class TestRDocMethodAttr < XrefTestCase
|
|||
refute_equal @c1_m, @parent_m
|
||||
end
|
||||
|
||||
def test_pretty_print
|
||||
temp_dir do |tmpdir|
|
||||
s = RDoc::RI::Store.new tmpdir
|
||||
s.rdoc = @rdoc
|
||||
|
||||
top_level = s.add_file 'file.rb'
|
||||
meth_bang = RDoc::AnyMethod.new nil, 'method!'
|
||||
meth_bang.record_location top_level
|
||||
|
||||
meth_bang_alias = RDoc::Alias.new nil, 'method!', 'method_bang', ''
|
||||
meth_bang_alias.record_location top_level
|
||||
|
||||
klass = top_level.add_class RDoc::NormalClass, 'Object'
|
||||
klass.add_method meth_bang
|
||||
|
||||
meth_bang.add_alias meth_bang_alias, klass
|
||||
|
||||
s.save
|
||||
|
||||
meth_alias_from_store = s.load_method 'Object', '#method_bang'
|
||||
|
||||
expected = "[RDoc::AnyMethod Object#method_bang public alias for method!]"
|
||||
actual = mu_pp meth_alias_from_store
|
||||
assert_equal expected, actual
|
||||
end
|
||||
end
|
||||
|
||||
def test_to_s
|
||||
assert_equal 'RDoc::AnyMethod: C1#m', @c1_m.to_s
|
||||
assert_equal 'RDoc::AnyMethod: C2#b', @c2_b.to_s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue