summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-26 05:41:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-26 05:41:37 +0000
commit60dad06d53757ece68be7bcd1968462cf1dee18a (patch)
tree675268d4e5556aaebe516dde79fc3f61c17bfddf /test/ruby
parenta12e8fd2ed5fa6cb4b30b28e96c2442587a7aef8 (diff)
numeric.c: wrong type step should raise TypeError
* numeric.c (num_step_scan_args): comparison String with Numeric should raise TypeError. it is an invalid type, but not a mismatch the number of arguments. [ruby-core:62430] [Bug #9810] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_float.rb2
-rw-r--r--test/ruby/test_numeric.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 3afd26d0b4..aeac359081 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -601,7 +601,7 @@ class TestFloat < Test::Unit::TestCase
end
def test_num2dbl
- assert_raise(ArgumentError) do
+ assert_raise(TypeError) 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 5c55539d91..1710cf8d84 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -262,8 +262,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(ArgumentError) { 1.step(10, "1") { } }
- assert_raise(ArgumentError) { 1.step(10, "1").size }
+ assert_raise(TypeError) { 1.step(10, "1") { } }
+ assert_raise(TypeError) { 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) }