From cf4d4c32f341ef342e91c367dbd414147ed08542 Mon Sep 17 00:00:00 2001 From: eregon Date: Tue, 12 Dec 2017 23:41:34 +0000 Subject: Revert r61192 and r61193 * More general fix coming. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/lib/test/unit/assertions.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/lib/test/unit') diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index 9bb8686e1f..fda2299eb0 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -133,10 +133,13 @@ module Test raise TypeError, "Expected #{expected.inspect} to be a kind of String or Regexp, not #{expected.class}" end - ex = assert_raise(exception, msg || proc {"Exception(#{exception}) with message matches to #{expected.inspect}"}) do - yield + ex = m = nil + EnvUtil.with_default_internal(expected.encoding) do + ex = assert_raise(exception, msg || proc {"Exception(#{exception}) with message matches to #{expected.inspect}"}) do + yield + end + m = ex.message end - m = ex.message msg = message(msg, "") {"Expected Exception(#{exception}) was raised, but the message doesn't match"} if assert == :assert_equal -- cgit v1.2.3