Sha256: 6b63f5c0bf29449a229ac820584526ec8f9276330e423badf81db97cde094fda

Contents?: true

Size: 696 Bytes

Versions: 26

Compression:

Stored size: 696 Bytes

Contents

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'be_able_to' do
  it 'loads_file_with_dashes_in_header_fields as strings' do
    options = {:strings_as_keys => true}
    data = SmarterCSV.process("#{fixture_path}/with_dashes.csv", options)
    data.flatten.size.should == 5
    data[0]['first_name'].should eq 'Dan'
    data[0]['last_name'].should eq 'McAllister'
  end

  it 'loads_file_with_dashes_in_header_fields as symbols' do
    options = {:strings_as_keys => false}
    data = SmarterCSV.process("#{fixture_path}/with_dashes.csv", options)
    data.flatten.size.should == 5
    data[0][:first_name].should eq 'Dan'
    data[0][:last_name].should eq 'McAllister'
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

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