2019-04-15 00:01:51 +03:00
|
|
|
require "tempfile"
|
2010-12-25 09:58:58 +03:00
|
|
|
require "test/unit"
|
|
|
|
|
|
|
|
require "csv"
|
|
|
|
|
2019-07-02 03:43:33 +03:00
|
|
|
require_relative "../../tool/lib/with_different_ofs.rb"
|
2019-04-15 00:01:51 +03:00
|
|
|
|
|
|
|
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
|