Sha256: 8f73f0cff83db8163794ab485ac3b8a303d16e9f210a87011758721ced7ec393

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

# encoding: utf-8

###
#  to run use
#     ruby -I ./lib -I ./test test/test_clubs.rb


require 'helper'

class TestClubs < MiniTest::Test

  Club = SportDb::Import::Club

  def test_create
    club = Club.create( name: 'Rapid Wien' )

    assert_equal 'Rapid Wien',   club.name
    assert_equal ['Rapid Wien'], club.names
  end


  def test_duplicates
    club = Club.new
    club.name = 'Rapid Wien'

    assert_equal false, club.duplicates?
    duplicates = {}
    assert_equal duplicates,  club.duplicates

    club.alt_names_auto += ['Rapid', 'Rapid Wien', 'SK Rapid Wien']

    pp club

    assert_equal true,              club.duplicates?
    duplicates = {'rapidwien'=>['Rapid Wien','Rapid Wien']}
    pp club.duplicates
    assert_equal duplicates, club.duplicates
  end

end # class TestClubs

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sportdb-formats-0.4.0 test/test_clubs.rb
sportdb-formats-0.3.0 test/test_clubs.rb