Sha256: 3b003a54512c8e5f441a94814e1bbbd85c5278689ed57d9607ddc717a5c123b0
Contents?: true
Size: 820 Bytes
Versions: 9
Compression:
Stored size: 820 Bytes
Contents
require_relative 'test_helper' # Unit Test for IOStreams::File module Streams class CSVReaderTest < Minitest::Test describe IOStreams::CSV::Reader do before do @file_name = File.join(File.dirname(__FILE__), 'files', 'test.csv') @data = CSV.read(@file_name) end describe '.open' do it 'file' do rows = [] IOStreams::CSV::Reader.open(@file_name) do |io| io.each { |row| rows << row } end assert_equal @data, rows end it 'stream' do rows = [] File.open(@file_name) do |file| IOStreams::CSV::Reader.open(file) do |io| io.each { |row| rows << row } end end assert_equal @data, rows end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems