Sha256: af081a3cdda751d6f7db987268c1f0d8288c529d5579452d304eec6a3878f4f1

Contents?: true

Size: 1.29 KB

Versions: 29

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'process files with line endings explicitly pre-specified' do
  it 'reads file with \n line endings' do
    options = {:row_sep => "\n"}
    data = SmarterCSV.process("#{fixture_path}/line_endings_n.csv", options)
    data.size.should == 3
  end

  it 'reads file with \r line endings' do
    options = {:row_sep => "\r"}
    data = SmarterCSV.process("#{fixture_path}/line_endings_r.csv", options)
    data.size.should == 3
   end

  it 'reads file with \r\n line endings' do
    options = {:row_sep => "\r\n"}
    data = SmarterCSV.process("#{fixture_path}/line_endings_rn.csv", options)
    data.size.should == 3
   end
end

describe 'process files with line endings in automatic mode' do
  it 'reads file with \n line endings' do
    options = {:row_sep => :auto}
    data = SmarterCSV.process("#{fixture_path}/line_endings_n.csv", options)
    data.size.should == 3
  end

  it 'reads file with \r line endings' do
    options = {:row_sep => :auto}
    data = SmarterCSV.process("#{fixture_path}/line_endings_r.csv", options)
    data.size.should == 3
   end

  it 'reads file with \r\n line endings' do
    options = {:row_sep => :auto}
    data = SmarterCSV.process("#{fixture_path}/line_endings_rn.csv", options)
    data.size.should == 3
   end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
smarter_csv-1.6.1 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.6.0 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.5.2 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.5.1 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.5.0 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.4.2 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.4.0 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.3.0 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.8 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.7 spec/smarter_csv/line_ending_spec.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/line_ending_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/line_ending_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/line_ending_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/line_ending_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.6 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.5 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.4 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.3 spec/smarter_csv/line_ending_spec.rb
smarter_csv-1.2.0 spec/smarter_csv/line_ending_spec.rb