Sha256: a40eba099127465f30c5ba01579dc1912f7e011595106f0daf51ebb079a9c11c

Contents?: true

Size: 605 Bytes

Versions: 29

Compression:

Stored size: 605 Bytes

Contents

require 'spec_helper'

fixture_path = 'spec/fixtures'

describe 'be_able_to' do
  it 'loads_csv_file_without_header' do 
    options = {:headers_in_file => false, :user_provided_headers => [:a,:b,:c,:d,:e,:f]}
    data = SmarterCSV.process("#{fixture_path}/no_header.csv", options)
    data.size.should == 5
    # all the keys should be symbols
    data.each{|item| item.keys.each{|x| x.class.should be == Symbol}}

    data.each do |item| 
      item.keys.each do |key|
        [:a,:b,:c,:d,:e,:f].should include( key )
      end
    end

    data.each do |h|
      h.size.should <= 6
    end
  end

end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
smarter_csv-1.5.0 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.4.2 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.4.0 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.3.0 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.8 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.7 spec/smarter_csv/no_header_spec.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/no_header_spec.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/no_header_spec.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/no_header_spec.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/no_header_spec.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/smarter_csv-1.2.6/spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.6 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.5 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.4 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.3 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.2.0 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.1.5 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.1.4 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.1.3 spec/smarter_csv/no_header_spec.rb
smarter_csv-1.1.2 spec/smarter_csv/no_header_spec.rb