diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-02 00:32:30 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-02 00:32:30 +0000 |
commit | cc2a16d94d744d14d4a5eb06eca22137f8a9b79e (patch) | |
tree | 2907a20e2d9ae3a2831707056bb3fe2d384b066d /test/rdoc/test_rdoc_any_method.rb | |
parent | 918f625a5eeba35b9b191cb39c1d634b4cc7efee (diff) | |
download | ruby-cc2a16d94d744d14d4a5eb06eca22137f8a9b79e.tar.gz |
Import RDoc 3.5.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_any_method.rb')
-rw-r--r-- | test/rdoc/test_rdoc_any_method.rb | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_any_method.rb b/test/rdoc/test_rdoc_any_method.rb index 2a7ae9042a..2104322c91 100644 --- a/test/rdoc/test_rdoc_any_method.rb +++ b/test/rdoc/test_rdoc_any_method.rb @@ -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 |