diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-25 11:42:31 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-25 11:42:31 +0000 |
commit | ef968551c8a52f33939d46db20557320f4a2ecc9 (patch) | |
tree | 5be6f667920e6dd7bca9130204f52946a376d4e6 /test/ruby | |
parent | d2062d6e110a5c97850820bcba12fd3aff041806 (diff) | |
download | ruby-ef968551c8a52f33939d46db20557320f4a2ecc9.tar.gz |
no longer rescue exceptions of #coerce in Integer#step
* numeric.c (num_step_negative_p): no more error hiding.
* test/ruby/test_float.rb, test/ruby/test_numeric.rb:
follow the change. [Feature #7688]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_float.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_numeric.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 2b6724a963..579b1d186a 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -788,7 +788,7 @@ class TestFloat < Test::Unit::TestCase end def test_num2dbl - assert_raise(TypeError) do + assert_raise(ArgumentError, "comparison of String with 0 failed") do 1.0.step(2.0, "0.5") {} end assert_raise(TypeError) do diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index 4f4fd5cc3e..49008247ed 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -261,8 +261,8 @@ class TestNumeric < Test::Unit::TestCase assert_raise(ArgumentError) { 1.step(10, 1, 0).size } assert_raise(ArgumentError) { 1.step(10, 0) { } } assert_raise(ArgumentError) { 1.step(10, 0).size } - assert_raise(TypeError) { 1.step(10, "1") { } } - assert_raise(TypeError) { 1.step(10, "1").size } + assert_raise(ArgumentError) { 1.step(10, "1") { } } + assert_raise(ArgumentError) { 1.step(10, "1").size } assert_raise(TypeError) { 1.step(10, nil) { } } assert_raise(TypeError) { 1.step(10, nil).size } assert_nothing_raised { 1.step(by: 0, to: nil) } |