summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_any_method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_any_method.rb')
-rw-r--r--test/rdoc/test_rdoc_any_method.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_any_method.rb b/test/rdoc/test_rdoc_any_method.rb
index 77acfbee17..90305807f8 100644
--- a/test/rdoc/test_rdoc_any_method.rb
+++ b/test/rdoc/test_rdoc_any_method.rb
@@ -334,6 +334,35 @@ method(a, b) { |c, d| ... }
assert_equal %w[a b c d], m.param_list
end
+ def test_param_list_empty_params_with_block
+ m = RDoc::AnyMethod.new nil, 'method'
+ m.parent = @c1
+
+ m.params = '()'
+ m.block_params = 'a, b'
+
+ assert_equal %w[a b], m.param_list
+ end
+
+ def test_param_list_ampersand_param_block_params
+ m = RDoc::AnyMethod.new nil, 'method'
+ m.parent = @c1
+
+ m.params = '(a, b, &block)'
+ m.block_params = 'c, d'
+
+ assert_equal %w[a b c d], m.param_list
+ end
+
+ def test_param_list_ampersand_param
+ m = RDoc::AnyMethod.new nil, 'method'
+ m.parent = @c1
+
+ m.params = '(a, b, &block)'
+
+ assert_equal %w[a b block], m.param_list
+ end
+
def test_param_seq
m = RDoc::AnyMethod.new nil, 'method'
m.parent = @c1