summaryrefslogtreecommitdiff
path: root/test/lib/test
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 23:41:50 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 23:41:50 +0000
commitd5874f0fffa1e12920ae267ad81acf651475cd64 (patch)
tree8f9b8dd8080340f27867a2bc75b863bcd95aa418 /test/lib/test
parentcf4d4c32f341ef342e91c367dbd414147ed08542 (diff)
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
Diffstat (limited to 'test/lib/test')
-rw-r--r--test/lib/test/unit/assertions.rb4
1 files changed, 2 insertions, 2 deletions
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
}
}