diff options
-rw-r--r-- | test/ruby/test_module.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 1696775f50..6d08bf6c00 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -686,7 +686,9 @@ class TestModule < Test::Unit::TestCase assert_raise(NameError) { c1.const_set("X\u{3042}".encode("utf-32be"), :foo) } assert_raise(NameError) { c1.const_set("X\u{3042}".encode("utf-32le"), :foo) } cx = EnvUtil.labeled_class("X\u{3042}") - assert_raise_with_message(TypeError, /X\u{3042}/) { c1.const_set(cx, :foo) } + EnvUtil.with_default_internal(Encoding::UTF_8) { + assert_raise_with_message(TypeError, /X\u{3042}/) { c1.const_set(cx, :foo) } + } end def test_const_get_invalid_name |