sportdb-catalogs 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,42 +0,0 @@
1
- ###
2
- # to run use
3
- # ruby -I ./lib -I ./test test/test_wiki_index.rb
4
-
5
-
6
- require 'helper'
7
-
8
- class TestWikiIndex < MiniTest::Test
9
-
10
- Club = SportDb::Import::Club
11
-
12
- COUNTRIES = SportDb::Import.catalog.countries
13
-
14
-
15
- def test_clubs
16
- ## note: CANNOT run if no "custom" clubs_dir set
17
- return if SportDb::Import.config.clubs_dir.nil?
18
-
19
- wiki = SportDb::Import::WikiIndex.build( SportDb::Import.config.clubs_dir )
20
- ## pp wiki
21
-
22
- ##############################################
23
- ## test wikipedia names and links/urls
24
- be = COUNTRIES.find( 'be' )
25
-
26
- club = Club.new
27
- club.name = 'Club Brugge KV'
28
- club.country = be
29
-
30
- rec = wiki.find_by( club: club )
31
- assert_equal 'Club Brugge KV', rec.name
32
-
33
-
34
- club = Club.new
35
- club.name = 'RSC Anderlecht'
36
- club.country = be
37
-
38
- rec = wiki.find_by( club: club )
39
- assert_equal 'R.S.C. Anderlecht', rec.name
40
- end
41
-
42
- end # class TestWikiIndex