sportdb 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,6 @@
3
3
 
4
4
  ## minitest setup
5
5
 
6
- # require 'minitest/unit'
7
6
  require 'minitest/autorun'
8
7
 
9
8
 
@@ -60,6 +59,60 @@ ClubSquadReader = SportDb::ClubSquadReader
60
59
 
61
60
  PersonReader = PersonDb::PersonReader
62
61
 
62
+ ######
63
+ # New Reader ShortCuts
64
+
65
+ module TestTeamReader
66
+ def self.from_file( name, more_attribs={} )
67
+ TeamReader.from_file( "#{SportDb.test_data_path}/#{name}.txt", more_attribs )
68
+ end
69
+ end
70
+
71
+ module TestClubSquadReader
72
+ def self.from_file( name, more_attribs={} )
73
+ ClubSquadReader.from_file( "#{SportDb.test_data_path}/#{name}.txt", more_attribs )
74
+ end
75
+ end
76
+
77
+ module TestNationalTeamSquadReader
78
+ def self.from_file( name, more_attribs={} )
79
+ NationalTeamSquadReader.from_file( "#{SportDb.test_data_path}/#{name}.txt", more_attribs )
80
+ end
81
+ end
82
+
83
+ module TestLeagueReader
84
+ def self.from_file( name, more_attribs={} )
85
+ LeagueReader.from_file( "#{SportDb.test_data_path}/#{name}.txt", more_attribs )
86
+ end
87
+ end
88
+
89
+ module TestSeasonReader
90
+ def self.from_file( name )
91
+ SeasonReader.from_file( "#{SportDb.test_data_path}/#{name}.txt" )
92
+ end
93
+ end
94
+
95
+ module TestEventReader
96
+ def self.from_file( name )
97
+ EventReader.from_file( "#{SportDb.test_data_path}/#{name}.yml" )
98
+ end
99
+ end
100
+
101
+ module TestGameReader
102
+ ## NOTE: pass in .yml as path (that is, event config!!!!)
103
+ def self.from_file( name, more_attribs={} )
104
+ GameReader.from_file( "#{SportDb.test_data_path}/#{name}.yml", more_attribs )
105
+ end
106
+ end
107
+
108
+ module TestAssocReader
109
+ def self.from_file( name )
110
+ AssocReader.from_file( "#{SportDb.test_data_path}/#{name}.txt" )
111
+ end
112
+ end
113
+
114
+
115
+
63
116
  #################################
64
117
  # setup db -> schema / tables
65
118
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'helper'
11
11
 
12
- class TestAssocReader < MiniTest::Unit::TestCase
12
+ class TestAssocReaderXX < MiniTest::Test # note: TestAssocReader alreay defined, thus, add xx
13
13
 
14
14
  def setup
15
15
  WorldDb.delete!
@@ -79,8 +79,8 @@ class TestAssocReader < MiniTest::Unit::TestCase
79
79
 
80
80
 
81
81
  def test_assocs
82
- reader = AssocReader.new( SportDb.test_data_path )
83
- reader.read( 'national-teams/assocs' )
82
+ reader = TestAssocReader.from_file( 'national-teams/assocs' )
83
+ reader.read()
84
84
 
85
85
  assert_equal 20, Assoc.count
86
86
 
@@ -124,7 +124,8 @@ class TestAssocReader < MiniTest::Unit::TestCase
124
124
  ca = Country.create!( key: 'ca', name: 'Canada', code: 'CAN', pop: 1, area: 1)
125
125
  us = Country.create!( key: 'us', name: 'United States', code: 'USA', pop: 1, area: 1)
126
126
 
127
- reader.read( 'national-teams/north-america/assocs' )
127
+ reader = TestAssocReader.from_file( 'national-teams/north-america/assocs' )
128
+ reader.read()
128
129
 
129
130
  assert_equal 23, Assoc.count
130
131
 
@@ -148,8 +149,8 @@ class TestAssocReader < MiniTest::Unit::TestCase
148
149
 
149
150
 
150
151
  def test_teams
151
- assocreader = AssocReader.new( SportDb.test_data_path )
152
- assocreader.read( 'national-teams/assocs' )
152
+ assocreader = TestAssocReader.from_file( 'national-teams/assocs' )
153
+ assocreader.read()
153
154
 
154
155
  assert_equal 20, Assoc.count
155
156
 
@@ -172,12 +173,13 @@ class TestAssocReader < MiniTest::Unit::TestCase
172
173
  area: 1)
173
174
  end
174
175
 
175
- teamreader = TeamReader.new( SportDb.test_data_path )
176
- teamreader.read( 'national-teams/teams' )
177
- teamreader.read( 'national-teams/north-america/teams' )
176
+ teamreader = TestTeamReader.from_file( 'national-teams/teams' )
177
+ teamreader.read()
178
+ teamreader = TestTeamReader.from_file( 'national-teams/north-america/teams' )
179
+ teamreader.read()
178
180
 
179
181
  assert_equal 9, Team.count
180
-
182
+
181
183
  ## fifa = Assoc.find_by_key!( 'fifa' )
182
184
  ## assert_equal 7, fifa.teams.count
183
185
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'helper'
4
4
 
5
- class TestChanges < MiniTest::Unit::TestCase
5
+ class TestChanges < MiniTest::Test
6
6
 
7
7
  def test_scores
8
8
  game1 = Game.new
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'helper'
4
4
 
5
- class TestCursor < MiniTest::Unit::TestCase
5
+ class TestCursor < MiniTest::Test
6
6
 
7
7
  def test_games
8
8
  games = []
@@ -6,7 +6,7 @@
6
6
 
7
7
  require 'helper'
8
8
 
9
- class TestDate < MiniTest::Unit::TestCase
9
+ class TestDate < MiniTest::Test
10
10
 
11
11
  def test_date
12
12
  data = [
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'helper'
11
11
 
12
- class TestGoals < MiniTest::Unit::TestCase
12
+ class TestGoals < MiniTest::Test
13
13
 
14
14
  def setup
15
15
  WorldDb.delete!
@@ -69,13 +69,13 @@ class TestGoals < MiniTest::Unit::TestCase
69
69
 
70
70
 
71
71
  def test_world_cup_1930
72
- teamreader = TeamReader.new( SportDb.test_data_path )
73
- teamreader.read( 'world-cup/teams_1930' )
72
+ teamreader = TestTeamReader.from_file( 'world-cup/teams_1930' )
73
+ teamreader.read()
74
74
 
75
75
  assert_equal 13, Team.count
76
76
 
77
- seasonreader = SeasonReader.new( SportDb.test_data_path )
78
- seasonreader.read( 'world-cup/seasons_1930')
77
+ seasonreader = TestSeasonReader.from_file( 'world-cup/seasons_1930' )
78
+ seasonreader.read()
79
79
 
80
80
  assert_equal 1, Season.count
81
81
 
@@ -83,8 +83,8 @@ class TestGoals < MiniTest::Unit::TestCase
83
83
  assert_equal '1930', y.title
84
84
 
85
85
 
86
- leaguereader = LeagueReader.new( SportDb.test_data_path )
87
- leaguereader.read( 'world-cup/leagues' )
86
+ leaguereader = TestLeagueReader.from_file( 'world-cup/leagues' )
87
+ leaguereader.read()
88
88
 
89
89
  assert_equal 1, League.count
90
90
 
@@ -92,8 +92,8 @@ class TestGoals < MiniTest::Unit::TestCase
92
92
  assert_equal 'World Cup', l.title
93
93
 
94
94
 
95
- gamereader = GameReader.new( SportDb.test_data_path )
96
- gamereader.read( 'world-cup/1930/cup_goals' )
95
+ gamereader = TestGameReader.from_file( 'world-cup/1930/cup_goals' )
96
+ gamereader.read()
97
97
 
98
98
  assert_equal 1, Event.count
99
99
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  require 'helper'
10
10
 
11
- class TestLang < MiniTest::Unit::TestCase
11
+ class TestLang < MiniTest::Test
12
12
 
13
13
  def test_getters
14
14
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'helper'
11
11
 
12
- class TestLoad < MiniTest::Unit::TestCase
12
+ class TestLoad < MiniTest::Test
13
13
 
14
14
  def setup
15
15
  WorldDb.delete!
@@ -26,8 +26,8 @@ class TestLoad < MiniTest::Unit::TestCase
26
26
  reader = Reader.new( SportDb.test_data_path )
27
27
 
28
28
  ## fix: add to country_matcher - allow players/br-brazil.txt e.g. country encode in file
29
- reader.load( 'players/south-america/br-brazil/players' )
30
- assert_equal 30, Person.count
29
+ ## reader.load( 'players/south-america/br-brazil/players' )
30
+ ## assert_equal 30, Person.count
31
31
 
32
32
  reader.load( 'world-cup/leagues' )
33
33
  assert_equal 1, League.count
@@ -45,8 +45,8 @@ class TestLoad < MiniTest::Unit::TestCase
45
45
 
46
46
  reader = Reader.new( SportDb.test_data_path )
47
47
 
48
- reader.load( 'players/europe/de-deutschland/players' )
49
- assert_equal 27, Person.count
48
+ ## reader.load( 'players/europe/de-deutschland/players' )
49
+ ## assert_equal 27, Person.count
50
50
 
51
51
  reader.load( 'world-cup/leagues' )
52
52
  assert_equal 1, League.count
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'helper'
11
11
 
12
- class TestReader < MiniTest::Unit::TestCase
12
+ class TestReader < MiniTest::Test
13
13
 
14
14
  def setup
15
15
  WorldDb.delete!
@@ -19,16 +19,16 @@ class TestReader < MiniTest::Unit::TestCase
19
19
 
20
20
  def test_bl
21
21
  at = Country.create!( key: 'at', name: 'Austria', code: 'AUT', pop: 1, area: 1)
22
-
23
- teamreader = TeamReader.new( SportDb.test_data_path )
24
- teamreader.read( 'at-austria/teams', country_id: at.id )
25
22
 
26
- leaguereader = LeagueReader.new( SportDb.test_data_path )
27
- leaguereader.read( 'at-austria/leagues', country_id: at.id )
23
+ teamreader = TestTeamReader.from_file( 'at-austria/teams', country_id: at.id )
24
+ teamreader.read()
25
+
26
+ leaguereader = TestLeagueReader.from_file( 'at-austria/leagues', country_id: at.id )
27
+ leaguereader.read()
28
28
 
29
- gamereader = GameReader.new( SportDb.test_data_path )
30
29
  ## check/fix: is country_id more_attribs needed? why? why not?
31
- gamereader.read( 'at-austria/2013_14/bl', country_id: at.id )
30
+ gamereader = TestGameReader.from_file( 'at-austria/2013_14/bl', country_id: at.id )
31
+ gamereader.read()
32
32
 
33
33
  bl = Event.find_by_key!( 'at.2013/14' )
34
34
 
@@ -41,9 +41,10 @@ class TestReader < MiniTest::Unit::TestCase
41
41
  def test_game_reader
42
42
  at = Country.create!( key: 'at', name: 'Austria', code: 'AUT', pop: 1, area: 1)
43
43
 
44
- teamreader = TeamReader.new( SportDb.test_data_path )
45
- teamreader.read( 'at-austria/teams', country_id: at.id )
46
- teamreader.read( 'at-austria/teams_2', country_id: at.id )
44
+ teamreader = TestTeamReader.from_file( 'at-austria/teams', country_id: at.id )
45
+ teamreader.read()
46
+ teamreader = TestTeamReader.from_file( 'at-austria/teams_2', country_id: at.id )
47
+ teamreader.read()
47
48
 
48
49
  austria = Team.find_by_key!( 'austria' )
49
50
  rapid = Team.find_by_key!( 'rapid' )
@@ -57,8 +58,8 @@ class TestReader < MiniTest::Unit::TestCase
57
58
  assert_equal 'RAP', rapid.code
58
59
  assert_equal 'STU', sturm.code
59
60
 
60
- leaguereader = LeagueReader.new( SportDb.test_data_path )
61
- leaguereader.read( 'at-austria/leagues', country_id: at.id )
61
+ leaguereader = TestLeagueReader.from_file( 'at-austria/leagues', country_id: at.id )
62
+ leaguereader.read()
62
63
 
63
64
  at1 = League.find_by_key!( 'at' )
64
65
  at2 = League.find_by_key!( 'at.2' )
@@ -68,10 +69,11 @@ class TestReader < MiniTest::Unit::TestCase
68
69
  assert_equal 'Österr. Erste Liga', at2.title
69
70
  assert_equal 'ÖFB Cup', atcup.title
70
71
 
71
- gamereader = GameReader.new( SportDb.test_data_path )
72
72
  ## check/fix: is country_id more_attribs needed? why? why not?
73
- gamereader.read( 'at-austria/2013_14/bl', country_id: at.id )
74
- gamereader.read( 'at-austria/2013_14/el', country_id: at.id )
73
+ gamereader = TestGameReader.from_file( 'at-austria/2013_14/bl', country_id: at.id )
74
+ gamereader.read()
75
+ gamereader = TestGameReader.from_file( 'at-austria/2013_14/el', country_id: at.id )
76
+ gamereader.read()
75
77
 
76
78
  bl = Event.find_by_key!( 'at.2013/14' )
77
79
  el = Event.find_by_key!( 'at.2.2013/14' )
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'helper'
11
11
 
12
- class TestReaderFromString < MiniTest::Unit::TestCase
12
+ class TestReaderFromString < MiniTest::Test
13
13
 
14
14
  def setup
15
15
  WorldDb.delete!
@@ -20,14 +20,14 @@ class TestReaderFromString < MiniTest::Unit::TestCase
20
20
  def test_bl
21
21
  at = Country.create!( key: 'at', name: 'Austria', code: 'AUT', pop: 1, area: 1)
22
22
 
23
- teamreader = TeamReader.new( SportDb.test_data_path )
24
- teamreader.read( 'at-austria/teams', country_id: at.id )
23
+ teamreader = TestTeamReader.from_file( 'at-austria/teams', country_id: at.id )
24
+ teamreader.read()
25
25
 
26
- leaguereader = LeagueReader.new( SportDb.test_data_path )
27
- leaguereader.read( 'at-austria/leagues', country_id: at.id )
26
+ leaguereader = TestLeagueReader.from_file( 'at-austria/leagues', country_id: at.id )
27
+ leaguereader.read()
28
28
 
29
- eventreader = EventReader.new( SportDb.test_data_path )
30
- eventreader.read( 'at-austria/2013_14/bl' )
29
+ eventreader = TestEventReader.from_file( 'at-austria/2013_14/bl' )
30
+ eventreader.read()
31
31
 
32
32
  bl = Event.find_by_key!( 'at.2013/14' )
33
33
 
@@ -36,20 +36,25 @@ class TestReaderFromString < MiniTest::Unit::TestCase
36
36
  assert_equal 0, bl.games.count # 36x5 = 180
37
37
 
38
38
 
39
+ ## fix: use File.readutf8 ??? why?? why not??
39
40
  bl_txt = File.read( "#{SportDb.test_data_path}/at-austria/2013_14/bl.txt" )
40
41
  bl_txt_ii = File.read( "#{SportDb.test_data_path}/at-austria/2013_14/bl_ii.txt" )
41
42
 
42
43
  text_ary = [bl_txt,bl_txt_ii]
43
44
 
44
- ## try reading from string -- fix: /tmp is a placeholder/remove
45
- gamereader = GameReader.new( '/tmp' )
46
- gamereader.read_fixtures_from_string( bl.key, text_ary )
45
+ gamereader = GameReader.from_string( bl, text_ary )
46
+ gamereader.read()
47
+
48
+ ## fix: add bl.key - allow event_keys too
49
+ ## gamereader = GameReader.from_string( bl.key, text_ary )
50
+ ## gamereader.read()
51
+
47
52
 
48
53
  assert_equal 36, bl.rounds.count
49
54
  assert_equal 180, bl.games.count # 36x5 = 180
50
55
 
51
56
  ## check if is stable (update will not create new matches and rounds) on second pass/rerun
52
- gamereader.read_fixtures_from_string( bl.key, text_ary )
57
+ gamereader.read()
53
58
 
54
59
  assert_equal 36, bl.rounds.count
55
60
  assert_equal 180, bl.games.count # 36x5 = 180
@@ -57,3 +62,4 @@ class TestReaderFromString < MiniTest::Unit::TestCase
57
62
 
58
63
 
59
64
  end # class TestReaderFromString
65
+
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'helper'
11
11
 
12
- class TestRoundAuto < MiniTest::Unit::TestCase
12
+ class TestRoundAuto < MiniTest::Test
13
13
 
14
14
  def setup
15
15
  WorldDb.delete!
@@ -69,29 +69,29 @@ class TestRoundAuto < MiniTest::Unit::TestCase
69
69
 
70
70
 
71
71
  def test_world_cup_1974
72
- teamreader = TeamReader.new( SportDb.test_data_path )
73
- teamreader.read( 'world-cup/teams_1974' )
72
+ teamreader = TestTeamReader.from_file( 'world-cup/teams_1974' )
73
+ teamreader.read()
74
74
 
75
75
  assert_equal 16, Team.count
76
76
 
77
- seasonreader = SeasonReader.new( SportDb.test_data_path )
78
- seasonreader.read( 'world-cup/seasons_1974')
77
+ seasonreader = TestSeasonReader.from_file( 'world-cup/seasons_1974' )
78
+ seasonreader.read()
79
79
 
80
80
  assert_equal 1, Season.count
81
81
 
82
82
  y = Season.find_by_key!( '1974' )
83
83
  assert_equal '1974', y.title
84
84
 
85
- leaguereader = LeagueReader.new( SportDb.test_data_path )
86
- leaguereader.read( 'world-cup/leagues' )
85
+ leaguereader = TestLeagueReader.from_file( 'world-cup/leagues' )
86
+ leaguereader.read()
87
87
 
88
88
  assert_equal 1, League.count
89
89
 
90
90
  l = League.find_by_key!( 'world' )
91
91
  assert_equal 'World Cup', l.title
92
92
 
93
- gamereader = GameReader.new( SportDb.test_data_path )
94
- gamereader.read( 'world-cup/1974/cup' )
93
+ gamereader = TestGameReader.from_file( 'world-cup/1974/cup' )
94
+ gamereader.read()
95
95
 
96
96
  assert_equal 1, Event.count
97
97
 
@@ -125,8 +125,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
125
125
  # note: update only works if rounds get not deleted or added
126
126
  # - (adding for updates works only at the end/tail - not at the beginning or inbetween, for example)
127
127
 
128
- gamereader = GameReader.new( SportDb.test_data_path )
129
- gamereader.read( 'world-cup/1974/cup' )
128
+ gamereader = TestGameReader.from_file( 'world-cup/1974/cup' )
129
+ gamereader.read()
130
130
 
131
131
  assert_equal 1, Event.count
132
132
 
@@ -142,8 +142,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
142
142
 
143
143
 
144
144
  def test_world_cup_1954
145
- teamreader = TeamReader.new( SportDb.test_data_path )
146
- teamreader.read( 'world-cup/teams_1954' )
145
+ teamreader = TestTeamReader.from_file( 'world-cup/teams_1954' )
146
+ teamreader.read()
147
147
 
148
148
  assert_equal 16, Team.count
149
149
 
@@ -152,8 +152,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
152
152
  [ 'uru', 'Uruguay', 'URU' ],
153
153
  [ 'bel', 'Belgium', 'BEL' ] ] )
154
154
 
155
- seasonreader = SeasonReader.new( SportDb.test_data_path )
156
- seasonreader.read( 'world-cup/seasons_1954')
155
+ seasonreader = TestSeasonReader.from_file( 'world-cup/seasons_1954' )
156
+ seasonreader.read()
157
157
 
158
158
  assert_equal 1, Season.count
159
159
 
@@ -161,8 +161,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
161
161
  assert_equal '1954', y.title
162
162
 
163
163
 
164
- leaguereader = LeagueReader.new( SportDb.test_data_path )
165
- leaguereader.read( 'world-cup/leagues' )
164
+ leaguereader = TestLeagueReader.from_file( 'world-cup/leagues' )
165
+ leaguereader.read()
166
166
 
167
167
  assert_equal 1, League.count
168
168
 
@@ -170,8 +170,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
170
170
  assert_equal 'World Cup', l.title
171
171
 
172
172
 
173
- gamereader = GameReader.new( SportDb.test_data_path )
174
- gamereader.read( 'world-cup/1954/cup' )
173
+ gamereader = TestGameReader.from_file( 'world-cup/1954/cup' )
174
+ gamereader.read()
175
175
 
176
176
  assert_equal 1, Event.count
177
177
 
@@ -200,8 +200,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
200
200
 
201
201
 
202
202
  def test_world_cup_1930
203
- teamreader = TeamReader.new( SportDb.test_data_path )
204
- teamreader.read( 'world-cup/teams_1930' )
203
+ teamreader = TestTeamReader.from_file( 'world-cup/teams_1930' )
204
+ teamreader.read()
205
205
 
206
206
  assert_equal 13, Team.count
207
207
 
@@ -210,8 +210,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
210
210
  [ 'bra', 'Brazil', 'BRA' ],
211
211
  [ 'bel', 'Belgium', 'BEL' ] ] )
212
212
 
213
- seasonreader = SeasonReader.new( SportDb.test_data_path )
214
- seasonreader.read( 'world-cup/seasons_1930')
213
+ seasonreader = TestSeasonReader.from_file( 'world-cup/seasons_1930' )
214
+ seasonreader.read()
215
215
 
216
216
  assert_equal 1, Season.count
217
217
 
@@ -219,8 +219,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
219
219
  assert_equal '1930', y.title
220
220
 
221
221
 
222
- leaguereader = LeagueReader.new( SportDb.test_data_path )
223
- leaguereader.read( 'world-cup/leagues' )
222
+ leaguereader = TestLeagueReader.from_file( 'world-cup/leagues' )
223
+ leaguereader.read()
224
224
 
225
225
  assert_equal 1, League.count
226
226
 
@@ -228,8 +228,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
228
228
  assert_equal 'World Cup', l.title
229
229
 
230
230
 
231
- gamereader = GameReader.new( SportDb.test_data_path )
232
- gamereader.read( 'world-cup/1930/cup' )
231
+ gamereader = TestGameReader.from_file( 'world-cup/1930/cup' )
232
+ gamereader.read()
233
233
 
234
234
  assert_equal 1, Event.count
235
235
 
@@ -259,8 +259,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
259
259
 
260
260
 
261
261
  def test_world_cup_1962
262
- teamreader = TeamReader.new( SportDb.test_data_path )
263
- teamreader.read( 'world-cup/teams_1962' )
262
+ teamreader = TestTeamReader.from_file( 'world-cup/teams_1962' )
263
+ teamreader.read()
264
264
 
265
265
  assert_equal 16, Team.count
266
266
 
@@ -269,8 +269,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
269
269
  [ 'bra', 'Brazil', 'BRA' ],
270
270
  [ 'ita', 'Italy', 'ITA' ] ] )
271
271
 
272
- seasonreader = SeasonReader.new( SportDb.test_data_path )
273
- seasonreader.read( 'world-cup/seasons_1962')
272
+ seasonreader = TestSeasonReader.from_file( 'world-cup/seasons_1962' )
273
+ seasonreader.read()
274
274
 
275
275
  assert_equal 1, Season.count
276
276
 
@@ -278,8 +278,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
278
278
  assert_equal '1962', y.title
279
279
 
280
280
 
281
- leaguereader = LeagueReader.new( SportDb.test_data_path )
282
- leaguereader.read( 'world-cup/leagues' )
281
+ leaguereader = TestLeagueReader.from_file( 'world-cup/leagues' )
282
+ leaguereader.read()
283
283
 
284
284
  assert_equal 1, League.count
285
285
 
@@ -287,8 +287,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
287
287
  assert_equal 'World Cup', l.title
288
288
 
289
289
 
290
- gamereader = GameReader.new( SportDb.test_data_path )
291
- gamereader.read( 'world-cup/1962/cup' )
290
+ gamereader = TestGameReader.from_file( 'world-cup/1962/cup' )
291
+ gamereader.read()
292
292
 
293
293
  assert_equal 1, Event.count
294
294
 
@@ -320,8 +320,8 @@ class TestRoundAuto < MiniTest::Unit::TestCase
320
320
  # note: update only works if rounds get not deleted or added
321
321
  # - (adding for updates works only at the end/tail - not at the beginning or inbetween, for example)
322
322
 
323
- gamereader = GameReader.new( SportDb.test_data_path )
324
- gamereader.read( 'world-cup/1962/cup' )
323
+ gamereader = TestGameReader.from_file( 'world-cup/1962/cup' )
324
+ gamereader.read()
325
325
 
326
326
  assert_equal 1, Event.count
327
327