mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/-test-/num2int/num2int.c: Rename utility methods
to global functions to ease manual experiments. * test/-ext-/num2int/test_num2int.rb: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7d3db3cc81
commit
d40335aa36
3 changed files with 24 additions and 23 deletions
|
@ -37,10 +37,9 @@ class TestNum2int < Test::Unit::TestCase
|
|||
|
||||
def assert_num2i_success_internal(exp, func, arg)
|
||||
mesg = "#{func}(#{arg.inspect})"
|
||||
method = "rb_#{func}".downcase
|
||||
out = nil
|
||||
assert_nothing_raised(mesg) {
|
||||
out = Num2int.send(method, arg)
|
||||
out = Kernel.send(func, arg)
|
||||
}
|
||||
assert_equal(exp, out, mesg)
|
||||
end
|
||||
|
@ -64,9 +63,8 @@ class TestNum2int < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def assert_num2i_error_internal(func, arg)
|
||||
method = "rb_#{func}".downcase
|
||||
assert_raise(RangeError, "#{func}(#{arg.inspect})") {
|
||||
Num2int.send(method, arg)
|
||||
Kernel.send(func, arg)
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -90,10 +88,9 @@ class TestNum2int < Test::Unit::TestCase
|
|||
|
||||
def assert_fix2i_success_internal(exp, func, arg)
|
||||
mesg = "#{func}(#{arg.inspect})"
|
||||
method = "rb_#{func}".downcase
|
||||
out = nil
|
||||
assert_nothing_raised(mesg) {
|
||||
out = Num2int.send(method, arg)
|
||||
out = Kernel.send(func, arg)
|
||||
}
|
||||
assert_equal(exp, out, mesg)
|
||||
end
|
||||
|
@ -105,9 +102,8 @@ class TestNum2int < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def assert_fix2i_error_internal(func, arg)
|
||||
method = "rb_#{func}".downcase
|
||||
assert_raise(RangeError, "#{func}(#{arg.inspect})") {
|
||||
Num2int.send(method, arg)
|
||||
Kernel.send(func, arg)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue