diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-15 08:16:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-15 08:16:34 +0000 |
commit | 5f3e675bdffee823f863ed94aa71e225178a37c3 (patch) | |
tree | b8ab455c351b77301e42881b67d3eb8e3bc9a064 /test | |
parent | f5a12ac596f6d4884ba64d56f50594e028b00839 (diff) | |
download | ruby-5f3e675bdffee823f863ed94aa71e225178a37c3.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_numeric.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index f2c1a51ba2..95f7368db6 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -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 |