From 5f3e675bdffee823f863ed94aa71e225178a37c3 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 15 Jan 2014 08:16:34 +0000 Subject: 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 --- test/ruby/test_numeric.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') 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 -- cgit v1.2.3