ruby-changes:62278
From: Sutou <ko1@a...>
Date: Mon, 20 Jul 2020 03:35:20 +0900 (JST)
Subject: [ruby-changes:62278] 9141aae8c2 (master): [ruby/csv] Suppress warnings
https://git.ruby-lang.org/ruby.git/commit/?id=9141aae8c2 From 9141aae8c2e2cf9ccf38a8c12828b284297c264b Mon Sep 17 00:00:00 2001 From: Sutou Kouhei <kou@c...> Date: Wed, 16 Oct 2019 09:36:06 +0900 Subject: [ruby/csv] Suppress warnings https://github.com/ruby/csv/commit/b37df55f46 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 https://github.com/ruby/ruby/blob/trunk/test/csv/write/test_general.rb#L222 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 v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/