Sha256: ae3dbe4d2ded176e547610012805244227d0c219120ba3d1b586b2358820ba54

Contents?: true

Size: 776 Bytes

Versions: 19

Compression:

Stored size: 776 Bytes

Contents

require 'spec_helper'

fixture_path = 'spec/fixtures'

# somebody reported that a column called 'options_trader' would be truncated to 'trader'

describe 'loads simple file format' do

  it 'with symbols as keys when using defaults' do
    options = {}
    data = SmarterCSV.process("#{fixture_path}/trading.csv", options)

    data.flatten.size.should eq 2
    data.each do |item|
      # all keys should be symbols when using v1.x backwards compatible mode
      item.keys.each{|x| x.class.should eq Symbol}
      item[:account_id].class.should eq Fixnum
      item[:options_trader].class.should eq String
      item[:stock_symbol].class.should eq String
      item[:shares_issued].class.should eq Fixnum
      item[:purchase_date].class.should eq String
    end
  end

end

Version data entries

19 entries across 19 versions & 2 rubygems

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