Skip to content

Commit

Permalink
Sort tests args tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Jan 12, 2011
1 parent c4f876d commit a37e2cd
Showing 1 changed file with 37 additions and 33 deletions.
70 changes: 37 additions & 33 deletions test/test_rdoc_parser_c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -761,32 +761,32 @@ 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'

assert_equal 1, bo.method_list.length

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'

assert_equal 1, bo.method_list.length

equals2 = bo.method_list.first

assert_equal '()', equals2.params
assert_equal '(p1)', equals2.params
end

def test_handle_method_args_2
Expand All @@ -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
Expand All @@ -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 ''

Expand Down

0 comments on commit a37e2cd

Please sign in to comment.