ruby-changes:32531
From: nobu <ko1@a...>
Date: Wed, 15 Jan 2014 17:17:02 +0900 (JST)
Subject: [ruby-changes:32531] nobu:r44609 (trunk): test_numeric.rb: coercion failures
nobu 2014-01-15 17:16:34 +0900 (Wed, 15 Jan 2014) New Revision: 44609 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44609 Log: test_numeric.rb: coercion failures * test/ruby/test_numeric.rb (test_coerce): new assertions for failure of coercion. Modified files: trunk/test/ruby/test_numeric.rb Index: test/ruby/test_numeric.rb =================================================================== --- test/ruby/test_numeric.rb (revision 44608) +++ test/ruby/test_numeric.rb (revision 44609) @@ -14,6 +14,11 @@ class TestNumeric < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_numeric.rb#L14 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/