From c4f876d95e0a4d7af9de845ec11ddb3633fa24f0 Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Tue, 11 Jan 2011 23:16:44 -0800 Subject: [PATCH] Test for rb_define_method(..., -2) --- test/test_rdoc_parser_c.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_rdoc_parser_c.rb b/test/test_rdoc_parser_c.rb index 78f0252ad2..78e72ad560 100644 --- a/test/test_rdoc_parser_c.rb +++ b/test/test_rdoc_parser_c.rb @@ -761,6 +761,20 @@ def test_handle_method assert_equal @top_level, m.file end + def test_handle_method_args_minus_2 + parser = util_parser "Document-method: BasicObject#==\n blah */" + + parser.handle_method 'method', 'rb_cBasicObject', '==', 'rb_obj_equal', -2 + + bo = @top_level.find_module_named 'BasicObject' + + assert_equal 1, bo.method_list.length + + equals2 = bo.method_list.first + + assert_equal '(*args)', equals2.params + end + def test_handle_method_args_0 parser = util_parser "Document-method: BasicObject#==\n blah */"