summaryrefslogtreecommitdiff
path: root/test/csv/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/csv/helper.rb')
-rw-r--r--test/csv/helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/csv/helper.rb b/test/csv/helper.rb
index 4f7b00244b..2542cc9c97 100644
--- a/test/csv/helper.rb
+++ b/test/csv/helper.rb
@@ -1,5 +1,18 @@
+require "tempfile"
require "test/unit"
require "csv"
require_relative "../lib/with_different_ofs.rb"
+
+module Helper
+ def with_chunk_size(chunk_size)
+ chunk_size_keep = ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"]
+ begin
+ ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"] = chunk_size
+ yield
+ ensure
+ ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"] = chunk_size_keep
+ end
+ end
+end