1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/csv] Suppress warnings

https://github.com/ruby/csv/commit/b37df55f46
This commit is contained in:
Sutou Kouhei 2019-10-16 09:36:06 +09:00 committed by Nobuyoshi Nakada
parent 172cfce6dc
commit 9141aae8c2
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2020-07-20 03:35:49 +09:00

View file

@ -222,13 +222,27 @@ module TestCSVWriteGeneral
end
end
def with_verbose(verbose)
original = $VERBOSE
begin
$VERBOSE = verbose
yield
ensure
$VERBOSE = original
end
end
def with_default_internal(encoding)
original = Encoding.default_internal
begin
Encoding.default_internal = encoding
with_verbose(false) do
Encoding.default_internal = encoding
end
yield
ensure
Encoding.default_internal = original
with_verbose(false) do
Encoding.default_internal = original
end
end
end
end