Sha256: 76b26ce759529f238aeb6d68b2859a3380ec205733f8cc6f1c49fd40843c16b8

Contents?: true

Size: 1.86 KB

Versions: 5

Compression:

Stored size: 1.86 KB

Contents

# encoding: utf-8

###
#  to run use
#     ruby -I ./lib -I ./test test/test_event_reader.rb
#  or better
#     rake -I ./lib test


require 'helper'

class TestEventReaderXX < MiniTest::Test  # note: TestEventReader alreay defined, thus, add xx

  def setup
    WorldDb.delete!
    SportDb.delete!
    PersonDb.delete!

    ## setup österr. bundesliga
    at     = Country.create!( key: 'at', name: 'Austria', code: 'AUT', pop: 1, area: 1)
    season = Season.create!( key: '2015/16', title: '2015/16' )
    bl     = League.create!( key: 'at', title: 'Österr. Bundesliga', club: true, country_id: at.id )

    ## read teams (required for db key lookup)
    teamreader = TestTeamReader.from_file( 'at-austria/teams', country_id: at.id )
    teamreader.read
    teamreader = TestTeamReader.from_file( 'at-austria/teams_2', country_id: at.id )
    teamreader.read
  end

  def test_bl
    r = TestEventReader.from_file( 'at-austria/2015_16/1-bundesliga' )
    r.read
    
    pp r.fixtures

    assert_equal ['1-bundesliga-i', '1-bundesliga-ii'], r.fixtures
    assert true   ## if we get here; assume everything ok
  end

  def test_bl_v2
    r = TestEventReader.from_file( 'at-austria/2015_16/1-bundesliga-v2' )
    r.read

    pp r.fixtures

    assert_equal ['1-bundesliga-v2'], r.fixtures
    assert true   ## if we get here; assume everything ok
  end



  ### fix/todo:
  ##   to be done - add support for Wiener Sportklub (RL Ost) => Wiener Sportklub lookups
  def xxxx_test_cup
    at     = Country.create!( key: 'at', name: 'Austria', code: 'AUT', pop: 1, area: 1)
    season = Season.create!( key: '2015/16', title: '2015/16' )
    cup     = League.create!( key: 'at.cup', title: 'Cup', club: true, country_id: at.id )

    r = TestEventReader.from_file( 'at-austria/2015_16/cup' )
    r.read
 
    assert true   ## if we get here; assume everything ok
  end

end # class TestEventReader


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sportdb-models-1.18.0 test/test_event_reader.rb
sportdb-models-1.17.0 test/test_event_reader.rb
sportdb-models-1.16.2 test/test_event_reader.rb
sportdb-models-1.16.1 test/test_event_reader.rb
sportdb-models-1.16.0 test/test_event_reader.rb