# encoding: utf-8 ### # to run use # ruby -I ./lib -I ./test test/test_club_reader_props.rb require 'helper' class TestClubPropsReader < MiniTest::Test ENG_CLUBS_PROPS_TXT =< 'chelsea', 'Name' => 'Chelsea FC', 'Code' => 'CHE' }, { 'Key' => 'arsenal', 'Name' => 'Arsenal FC', 'Code' => 'ARS' }], recs[0..1] end CLUBS = SportDb::Import.catalog.clubs def test_parse SportDb::Import::ClubPropsReader.parse( ENG_CLUBS_PROPS_TXT ) m = CLUBS.match( 'Chelsea FC' ) club = m[0] assert_equal 'chelsea', club.key assert_equal 'Chelsea FC', club.name assert_equal 'CHE', club.code m = CLUBS.match( 'Arsenal FC' ) club = m[0] assert_equal 'arsenal', club.key assert_equal 'Arsenal FC', club.name assert_equal 'ARS', club.code end # method test_parse end # class TestClubPropsProps