1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_numeric.rb: coercion failures

* test/ruby/test_numeric.rb (test_coerce): new assertions for
  failure of coercion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-01-15 08:16:34 +00:00
parent f5a12ac596
commit 5f3e675bdf

View file

@ -14,6 +14,11 @@ class TestNumeric < Test::Unit::TestCase
assert_equal(Float, b.class)
assert_raise(TypeError) { -Numeric.new }
assert_raise_with_message(TypeError, /can't be coerced into /) {1+:foo}
assert_raise_with_message(TypeError, /can't be coerced into /) {1&:foo}
assert_raise_with_message(TypeError, /can't be coerced into /) {1|:foo}
assert_raise_with_message(TypeError, /can't be coerced into /) {1^:foo}
end
def test_dummynumeric