summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-15 08:16:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-15 08:16:34 +0000
commit5f3e675bdffee823f863ed94aa71e225178a37c3 (patch)
treeb8ab455c351b77301e42881b67d3eb8e3bc9a064 /test
parentf5a12ac596f6d4884ba64d56f50594e028b00839 (diff)
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.rb5
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