diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-25 18:58:05 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-25 18:58:05 +0000 |
commit | 91e2cd34d4a8f8bd624a7fcd25c34239c8e3b319 (patch) | |
tree | cb1350068e0877b89fcab30dd7cf46a72651113c /test/ruby/test_object.rb | |
parent | 606e855622c2694c6bf1a5cec59373bef0d0877e (diff) | |
download | ruby-91e2cd34d4a8f8bd624a7fcd25c34239c8e3b319.tar.gz |
vm_method.c: preserve encodings
* vm_method.c (rb_mod_remove_method): preserve encodings of method
name and class name in error messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r-- | test/ruby/test_object.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index 94a6e9d201..a1514ed853 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -365,6 +365,19 @@ class TestObject < Test::Unit::TestCase end INPUT end + + m = "\u{30e1 30bd 30c3 30c9}" + c = Class.new + assert_raise_with_message(NameError, /#{m}/) do + c.class_eval {remove_method m} + end + c = Class.new { + define_method(m) {} + remove_method(m) + } + assert_raise_with_message(NameError, /#{m}/) do + c.class_eval {remove_method m} + end end def test_method_missing |