aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_class.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-28 03:28:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-28 03:28:50 +0000
commitda70f4d02a5251605bc6a44940a7784f9f613fcb (patch)
tree1adb8feeb797b350a31e8ff5c005a3cd836e2d34 /test/ruby/test_class.rb
parentc70572d5a8413f4c06977bf134a4cbef0d6789cf (diff)
downloadruby-da70f4d02a5251605bc6a44940a7784f9f613fcb.tar.gz
class.c: preserve encoding
* class.c (rb_check_inheritable): preserve encoding in an error message when the superclass is not a class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r--test/ruby/test_class.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 36aeaf2bdf..3508061840 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -193,6 +193,9 @@ class TestClass < Test::Unit::TestCase
assert_raise(TypeError) { Class.new(c) }
assert_raise(TypeError) { Class.new(Class) }
assert_raise(TypeError) { eval("class Foo < Class; end") }
+ m = "M\u{1f5ff}"
+ o = Class.new {break eval("class #{m}; self; end.new")}
+ assert_raise_with_message(TypeError, /#{m}/) {Class.new(o)}
end
def test_initialize_copy