From 9141aae8c2e2cf9ccf38a8c12828b284297c264b Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 16 Oct 2019 09:36:06 +0900 Subject: [ruby/csv] Suppress warnings https://github.com/ruby/csv/commit/b37df55f46 --- test/csv/write/test_general.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'test/csv/write') diff --git a/test/csv/write/test_general.rb b/test/csv/write/test_general.rb index d157b74ba1..bdc8aadd55 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 -- cgit v1.2.3