summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2019-10-16 09:36:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-20 02:32:49 +0900
commit9141aae8c2e2cf9ccf38a8c12828b284297c264b (patch)
tree2c9b99fc9b48e6085862f5f150f6436035409b08 /test/csv
parent172cfce6dc7a96ec0f7eac4f0d674ed772d0d098 (diff)
[ruby/csv] Suppress warnings
https://github.com/ruby/csv/commit/b37df55f46
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3332
Diffstat (limited to 'test/csv')
-rw-r--r--test/csv/write/test_general.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/csv/write/test_general.rb b/test/csv/write/test_general.rb
index d157b74..bdc8aad 100644
--- a/test/csv/write/test_general.rb
+++ b/test/csv/write/test_general.rb
@@ -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