1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Import RDoc 3.5.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-02-02 00:32:30 +00:00
parent 918f625a5e
commit cc2a16d94d
49 changed files with 2119 additions and 273 deletions

View file

@ -34,6 +34,12 @@ method(a, b) { |c, d| ... }
assert_equal call_seq, m.arglists
end
def test_c_function
@c1_m.c_function = 'my_c1_m'
assert_equal 'my_c1_m', @c1_m.c_function
end
def test_full_name
assert_equal 'C1::m', @c1.method_list.first.full_name
end
@ -97,6 +103,48 @@ method(a, b) { |c, d| ... }
assert_nil m.name
end
def test_param_list_block_params
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1
m.block_params = 'c, d'
assert_equal %w[c d], m.param_list
end
def test_param_list_call_seq
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1
call_seq = <<-SEQ
method(a) { |c| ... }
method(a, b) { |c, d| ... }
SEQ
m.call_seq = call_seq
assert_equal %w[a b c d], m.param_list
end
def test_param_list_params
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1
m.params = '(a, b)'
assert_equal %w[a b], m.param_list
end
def test_param_list_params_block_params
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1
m.params = '(a, b)'
m.block_params = 'c, d'
assert_equal %w[a b c d], m.param_list
end
def test_param_seq
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1
@ -117,6 +165,21 @@ method(a, b) { |c, d| ... }
assert_equal '(a, b) { |c, d| ... }', m.param_seq
end
def test_param_seq_call_seq
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1
call_seq = <<-SEQ
method(a) { |c| ... }
method(a, b) { |c, d| ... }
SEQ
m.call_seq = call_seq
assert_equal '(a, b) { |c, d| }', m.param_seq
end
def test_parent_name
assert_equal 'C1', @c1.method_list.first.parent_name
assert_equal 'C1', @c1.method_list.last.parent_name