Sha256: 8e6f707d8071018496fecb6fd80623ebfaccc625ec545adff8ea86e0fa761db5

Contents?: true

Size: 1.06 KB

Versions: 32

Compression:

Stored size: 1.06 KB

Contents

# encoding: utf-8

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


require 'helper'

class TestStandingsII < MiniTest::Test

  def setup
    WorldDb.delete!
    SportDb.delete!
    SportDb.read_builtin
  end

  def test_bl
    at = Country.create!( key: 'at', name: 'Austria', code: 'AUT', pop: 1, area: 1)
    
    teamreader = TestTeamReader.from_file( 'at-austria/teams', country_id: at.id )
    teamreader.read()

    leaguereader = TestLeagueReader.from_file( 'at-austria/leagues', country_id: at.id )
    leaguereader.read()

    ## check/fix: is country_id more_attribs needed? why? why not?
    gamereader = TestGameReader.from_file( 'at-austria/2013_14/bl', country_id: at.id )
    gamereader.read()

    bl = Event.find_by_key!( 'at.2013/14' )

    assert_equal  10, bl.teams.count
    assert_equal  36, bl.rounds.count
    assert_equal 180, bl.games.count  # 36x5 = 180

    standings = SportDb::Standings.new
    standings.update( bl.games )
    
    pp standings.to_a
  end


end # class TestStandingsII

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
sportdb-models-1.11.1 test/test_standings_ii.rb
sportdb-models-1.11.0 test/test_standings_ii.rb
sportdb-models-1.10.1 test/test_standings_ii.rb
sportdb-models-1.10.0 test/test_standings_ii.rb
sportdb-1.9.16 test/test_standings_ii.rb
sportdb-1.9.15 test/test_standings_ii.rb
sportdb-1.9.14 test/test_standings_ii.rb
sportdb-1.9.13 test/test_standings_ii.rb
sportdb-1.9.12 test/test_standings_ii.rb
sportdb-1.9.11 test/test_standings_ii.rb
sportdb-1.9.10 test/test_standings_ii.rb
sportdb-1.9.9 test/test_standings_ii.rb