From d5874f0fffa1e12920ae267ad81acf651475cd64 Mon Sep 17 00:00:00 2001 From: eregon Date: Tue, 12 Dec 2017 23:41:50 +0000 Subject: Capture the values of globals in EnvUtil to restore to the original * Avoids the thread-safety issues mentioned in r61192, when thread concurrently modify default Encodings or $VERBOSE. Their state will always be the original one once the test finishes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/lib/test/unit/assertions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/lib/test') diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index fda2299eb0..eed5aca6a4 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -678,8 +678,8 @@ eom end def assert_warning(pat, msg = nil) - stderr = EnvUtil.verbose_warning { - EnvUtil.with_default_internal(pat.encoding) { + stderr = EnvUtil.with_default_internal(pat.encoding) { + EnvUtil.verbose_warning { yield } } -- cgit v1.2.3