diff options
-rw-r--r-- | numeric.c | 6 | ||||
-rw-r--r-- | test/ruby/test_numeric.rb | 4 |
2 files changed, 5 insertions, 5 deletions
@@ -317,9 +317,9 @@ num_sadded(VALUE x, VALUE name) /* ruby_frame = ruby_frame->prev; */ /* pop frame for "singleton_method_added" */ rb_remove_method_id(rb_singleton_class(x), mid); rb_raise(rb_eTypeError, - "can't define singleton method \"%s\" for %s", - rb_id2name(mid), - rb_obj_classname(x)); + "can't define singleton method \"%"PRIsVALUE"\" for %"PRIsVALUE, + rb_id2str(mid), + rb_obj_class(x)); UNREACHABLE; } diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index fc4f39a91d..7fbb8e955d 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -58,8 +58,8 @@ class TestNumeric < Test::Unit::TestCase def test_numeric a = Numeric.new - assert_raise(TypeError) { def a.foo; end } - assert_raise(TypeError) { eval("def a.\u3042; end") } + assert_raise_with_message(TypeError, /foo/) { def a.foo; end } + assert_raise_with_message(TypeError, /\u3042/) { eval("def a.\u3042; end") } assert_raise(TypeError) { a.dup } end |