Import RDoc 2.5.4

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2010-04-19 05:08:28 +00:00
parent 37e59f5583
commit 75ef9e79d6
14 changed files with 169 additions and 77 deletions

View file

@ -227,6 +227,14 @@ class TestRDocContext < XrefTestCase
assert_equal 'RW', @c1.find_attribute_named('attr_accessor').rw
end
def test_find_class_method_named
assert_equal nil, @c1.find_class_method_named('none')
m = @c1.find_class_method_named('m')
assert_instance_of RDoc::AnyMethod, m
assert m.singleton
end
def test_find_constant_named
assert_equal nil, @c1.find_constant_named('NONE')
assert_equal ':const', @c1.find_constant_named('CONST').value
@ -248,7 +256,7 @@ class TestRDocContext < XrefTestCase
m = @c1.find_instance_method_named('m')
assert_instance_of RDoc::AnyMethod, m
assert_equal false, m.singleton
refute m.singleton
end
def test_find_local_symbol
@ -278,6 +286,12 @@ class TestRDocContext < XrefTestCase
assert_equal @c2_c3, @c2.find_symbol('C3')
end
def test_find_symbol_method
assert_equal @c1__m, @c1.find_symbol('m')
assert_equal @c1_m, @c1.find_symbol('#m')
assert_equal @c1__m, @c1.find_symbol('::m')
end
def test_spaceship
assert_equal(-1, @c2.<=>(@c3))
assert_equal 0, @c2.<=>(@c2)