ruby-changes:39108
From: usa <ko1@a...>
Date: Wed, 8 Jul 2015 00:57:35 +0900 (JST)
Subject: [ruby-changes:39108] usa:r51189 (trunk): * test/ruby/test_method.rb (TestMethod#test_{instance, define}_method): assumed
usa 2015-07-08 00:57:12 +0900 (Wed, 08 Jul 2015) New Revision: 51189 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51189 Log: * test/ruby/test_method.rb (TestMethod#test_{instance,define}_method): assumed default external is UTF-8. fixed failures introduced at r51175. * test/-ext-/symbol/test_type.rb (Test_Symbol::TestType#test_check_{id,symbol}_invalid_type): ditto. Modified files: trunk/test/-ext-/symbol/test_type.rb trunk/test/ruby/test_method.rb Index: test/ruby/test_method.rb =================================================================== --- test/ruby/test_method.rb (revision 51188) +++ test/ruby/test_method.rb (revision 51189) @@ -251,10 +251,12 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_method.rb#L251 m = o.method(:bar).unbind assert_raise(TypeError) { m.bind(Object.new) } - cx = EnvUtil.labeled_class("X\u{1f431}") - assert_raise_with_message(TypeError, /X\u{1f431}/) { - o.method(cx) - } + EnvUtil.with_default_external(Encoding::UTF_8) do + cx = EnvUtil.labeled_class("X\u{1f431}") + assert_raise_with_message(TypeError, /X\u{1f431}/) { + o.method(cx) + } + end end def test_bind_module_instance_method @@ -283,10 +285,12 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_method.rb#L285 assert_raise(TypeError) do Class.new.class_eval { define_method(:bar, o.method(:bar)) } end - cx = EnvUtil.labeled_class("X\u{1f431}") - assert_raise_with_message(TypeError, /X\u{1F431}/) { - Class.new {define_method(cx) {}} - } + EnvUtil.with_default_external(Encoding::UTF_8) do + cx = EnvUtil.labeled_class("X\u{1f431}") + assert_raise_with_message(TypeError, /X\u{1F431}/) { + Class.new {define_method(cx) {}} + } + end end def test_define_method_no_proc Index: test/-ext-/symbol/test_type.rb =================================================================== --- test/-ext-/symbol/test_type.rb (revision 51188) +++ test/-ext-/symbol/test_type.rb (revision 51189) @@ -122,17 +122,21 @@ module Test_Symbol https://github.com/ruby/ruby/blob/trunk/test/-ext-/symbol/test_type.rb#L122 end def test_check_id_invalid_type - cx = EnvUtil.labeled_class("X\u{1f431}") - assert_raise_with_message(TypeError, /X\u{1F431}/) { - Bug::Symbol.pinneddown?(cx) - } + EnvUtil.with_default_external(Encoding::UTF_8) do + cx = EnvUtil.labeled_class("X\u{1f431}") + assert_raise_with_message(TypeError, /X\u{1F431}/) { + Bug::Symbol.pinneddown?(cx) + } + end end def test_check_symbol_invalid_type - cx = EnvUtil.labeled_class("X\u{1f431}") - assert_raise_with_message(TypeError, /X\u{1F431}/) { - Bug::Symbol.find(cx) - } + EnvUtil.with_default_external(Encoding::UTF_8) do + cx = EnvUtil.labeled_class("X\u{1f431}") + assert_raise_with_message(TypeError, /X\u{1F431}/) { + Bug::Symbol.find(cx) + } + end end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/