Sha256: 670ecf6d9b063dde2e5f744f9cc0ecc61da28429284ab79846f1f517b334fd87

Contents?: true

Size: 690 Bytes

Versions: 16

Compression:

Stored size: 690 Bytes

Contents

# encoding: utf-8

###
#  to run use
#     ruby -I ./lib -I ./test test/test_csv_reader.rb


require 'helper'

class TestCsvReader < MiniTest::Test

  def test_parse
    recs = parse_csv( <<TXT )
### World Countries

key, fifa, name
af,  AFG,  Afghanistan
al,  ALB,  Albania
dz,  ALG,  Algeria
as,  ASA,  American Samoa (US)
TXT

   pp recs
   assert_equal  [{ key:'af', fifa:'AFG', name:'Afghanistan'},
                  { key:'al', fifa:'ALB', name:'Albania'},
                  { key:'dz', fifa:'ALG', name:'Algeria'},
                  { key:'as', fifa:'ASA', name:'American Samoa (US)'},
                 ], recs[0..3]
  end

end   # class TestCsvReader

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sportdb-formats-1.0.2 test/test_csv_reader.rb
sportdb-formats-1.0.1 test/test_csv_reader.rb
sportdb-formats-1.0.0 test/test_csv_reader.rb
sportdb-formats-0.4.0 test/test_csv_reader.rb
sportdb-formats-0.3.0 test/test_csv_reader.rb
sportdb-formats-0.2.1 test/test_csv_reader.rb
sportdb-formats-0.2.0 test/test_csv_reader.rb
sportdb-formats-0.1.7 test/test_csv_reader.rb
sportdb-formats-0.1.6 test/test_csv_reader.rb
sportdb-formats-0.1.5 test/test_csv_reader.rb
sportdb-formats-0.1.4 test/test_csv_reader.rb
sportdb-formats-0.1.3 test/test_csv_reader.rb
sportdb-formats-0.1.2 test/test_csv_reader.rb
sportdb-formats-0.1.1 test/test_csv_reader.rb
sportdb-formats-0.1.0 test/test_csv_reader.rb
sportdb-formats-0.0.1 test/test_csv_reader.rb