[前][次][番号順一覧][スレッド一覧]

ruby-changes:36394

From: nobu <ko1@a...>
Date: Tue, 18 Nov 2014 10:39:04 +0900 (JST)
Subject: [ruby-changes:36394] nobu:r48475 (trunk): test_module.rb: fix encoding

nobu	2014-11-18 10:38:50 +0900 (Tue, 18 Nov 2014)

  New Revision: 48475

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48475

  Log:
    test_module.rb: fix encoding
    
    * test/ruby/test_module.rb (test_const_set_invalid_name): warning
      message encoding depends on Encoding.default_internal.

  Modified files:
    trunk/test/ruby/test_module.rb
Index: test/ruby/test_module.rb
===================================================================
--- test/ruby/test_module.rb	(revision 48474)
+++ test/ruby/test_module.rb	(revision 48475)
@@ -686,7 +686,9 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L686
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]