add Numeric#/ tests; ref #1965

parent 514cafe6
......@@ -22,6 +22,16 @@ assert('Numeric#abs', '15.2.7.4.3') do
assert_equal(1.0, -1.abs)
end
assert('Numeric#/', '15.2.8.3.4') do
n = Class.new(Numeric){ def /(x); 15.1;end }.new
assert_equal(2, 10/5)
assert_equal(0.0625, 1/16)
assert_equal(15.1, n/10)
assert_raise(TypeError){ 1/n }
assert_raise(TypeError){ 1/nil }
end
# Not ISO specified
assert('Numeric#**') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment