aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_numeric.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-25 11:42:20 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-25 11:42:20 +0000
commitbc1827e8825c558bcda14a214280caf83dc1215b (patch)
treeb4253353c069b5d15ded64f1b97b2dbde2570e95 /test/ruby/test_numeric.rb
parent33f66084d5c60542939117d056bdcbb58f8100dc (diff)
downloadruby-bc1827e8825c558bcda14a214280caf83dc1215b.tar.gz
no longer rescue exceptions in numeric comparison operations
* numeric.c (do_coerce): no more error hiding. * test/ruby/test_numeric.rb: follow the change. [Feature #7688] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_numeric.rb')
-rw-r--r--test/ruby/test_numeric.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
index 92717e9f3b..4f4fd5cc3e 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -54,18 +54,16 @@ class TestNumeric < Test::Unit::TestCase
bug7688 = '[ruby-core:51389] [Bug #7688]'
a = Class.new(Numeric) do
- def coerce(x); raise StandardError; end
+ def coerce(x); raise StandardError, "my error"; end
end.new
- assert_raise_with_message(TypeError, /can't be coerced into /) { 1 + a }
- warn = /will no more rescue exceptions of #coerce.+ in the next release/m
- assert_warn(warn, bug7688) { assert_raise(ArgumentError) { 1 < a } }
+ assert_raise_with_message(StandardError, "my error") { 1 + a }
+ assert_raise_with_message(StandardError, "my error") { 1 < a }
a = Class.new(Numeric) do
def coerce(x); :bad_return_value; end
end.new
assert_raise_with_message(TypeError, "coerce must return [x, y]") { 1 + a }
- warn = /Bad return value for #coerce.+next release will raise an error/m
- assert_warn(warn, bug7688) { assert_raise(ArgumentError) { 1 < a } }
+ assert_raise_with_message(TypeError, "coerce must return [x, y]") { 1 < a }
end
def test_singleton_method