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:
parent
f5a12ac596
commit
5f3e675bdf
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue