summaryrefslogtreecommitdiff
path: root/test/csv/write
diff options
context:
space:
mode:
authorSeiei Miyagi <hanachin@gmail.com>2019-11-25 10:06:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-20 02:32:49 +0900
commit3c5b67e0db22ec9a15cef6c4961abf6f91373dd3 (patch)
tree411ce6296968dee8b017b8c6213a424eafb91e75 /test/csv/write
parentd57bc03ba98649661c7dedbb46ec2f2bb6bee9be (diff)
[ruby/csv] Ensuring StringIO's encoding in CSV.generate (#111)
https://github.com/ruby/csv/commit/dbf55ef008
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3332
Diffstat (limited to 'test/csv/write')
-rw-r--r--test/csv/write/test_general.rb26
1 files changed, 2 insertions, 24 deletions
diff --git a/test/csv/write/test_general.rb b/test/csv/write/test_general.rb
index bdc8aadd55c..677119e1ae4 100644
--- a/test/csv/write/test_general.rb
+++ b/test/csv/write/test_general.rb
@@ -4,6 +4,8 @@
require_relative "../helper"
module TestCSVWriteGeneral
+ include Helper
+
def test_tab
assert_equal("\t#{$INPUT_RECORD_SEPARATOR}",
generate_line(["\t"]))
@@ -221,30 +223,6 @@ module TestCSVWriteGeneral
generate_line(row))
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
- with_verbose(false) do
- Encoding.default_internal = encoding
- end
- yield
- ensure
- with_verbose(false) do
- Encoding.default_internal = original
- end
- end
- end
end
class TestCSVWriteGeneralGenerateLine < Test::Unit::TestCase