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:
parent
172cfce6dc
commit
9141aae8c2
Notes:
git
2020-07-20 03:35:49 +09:00
1 changed files with 16 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue