From a37e2cd81f6d7e2dcae3b37cbb9ff7c8253b6a2a Mon Sep 17 00:00:00 2001 From: Eric Hodel Date: Tue, 11 Jan 2011 23:17:54 -0800 Subject: [PATCH] Sort tests args tests --- test/test_rdoc_parser_c.rb | 70 ++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/test/test_rdoc_parser_c.rb b/test/test_rdoc_parser_c.rb index 78e72ad560..f642fa91ec 100644 --- a/test/test_rdoc_parser_c.rb +++ b/test/test_rdoc_parser_c.rb @@ -761,10 +761,10 @@ def test_handle_method assert_equal @top_level, m.file end - def test_handle_method_args_minus_2 + def test_handle_method_args_0 parser = util_parser "Document-method: BasicObject#==\n blah */" - parser.handle_method 'method', 'rb_cBasicObject', '==', 'rb_obj_equal', -2 + parser.handle_method 'method', 'rb_cBasicObject', '==', 'rb_obj_equal', 0 bo = @top_level.find_module_named 'BasicObject' @@ -772,13 +772,13 @@ def test_handle_method_args_minus_2 equals2 = bo.method_list.first - assert_equal '(*args)', equals2.params + assert_equal '()', equals2.params end - def test_handle_method_args_0 + def test_handle_method_args_1 parser = util_parser "Document-method: BasicObject#==\n blah */" - parser.handle_method 'method', 'rb_cBasicObject', '==', 'rb_obj_equal', 0 + parser.handle_method 'method', 'rb_cBasicObject', '==', 'rb_obj_equal', 1 bo = @top_level.find_module_named 'BasicObject' @@ -786,7 +786,7 @@ def test_handle_method_args_0 equals2 = bo.method_list.first - assert_equal '()', equals2.params + assert_equal '(p1)', equals2.params end def test_handle_method_args_2 @@ -803,33 +803,7 @@ def test_handle_method_args_2 assert_equal '(p1, p2)', equals2.params end - def test_handle_method_initialize - parser = util_parser "Document-method: BasicObject::new\n blah */" - - parser.handle_method('private_method', 'rb_cBasicObject', - 'initialize', 'rb_obj_dummy', -1) - - bo = @top_level.find_module_named 'BasicObject' - - assert_equal 1, bo.method_list.length - - new = bo.method_list.first - - assert_equal 'new', new.name - assert_equal :public, new.visibility - end - - def test_handle_method_star_args - parser = util_parser "Document-method: Object#m\n blah */" - - parser.handle_method 'method', 'rb_cObject', 'm', 'rb_m', -1 - - m = @top_level.find_module_named('Object').method_list.first - - assert_equal '(*args)', m.params - end - - def test_handle_method_rb_scan_args + def test_handle_method_args_minus_1 parser = util_parser "Document-method: Object#m\n blah */" body = <<-BODY @@ -847,6 +821,36 @@ def test_handle_method_rb_scan_args assert_equal '(p1)', m.params 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_initialize + parser = util_parser "Document-method: BasicObject::new\n blah */" + + parser.handle_method('private_method', 'rb_cBasicObject', + 'initialize', 'rb_obj_dummy', -1) + + bo = @top_level.find_module_named 'BasicObject' + + assert_equal 1, bo.method_list.length + + new = bo.method_list.first + + assert_equal 'new', new.name + assert_equal :public, new.visibility + end + def test_look_for_directives_in parser = util_parser ''