Sha256: 725f644ae7775bc2079674d25fba47f09a3a7c54aa8afe4f9e02bd4e0d0b01fe

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8

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


require 'helper'

class TestSeasonUtils < MiniTest::Test

  def test_directory
    assert_equal '2010-11',       SeasonUtils.directory( '2010-11' )
    assert_equal '2010-11',       SeasonUtils.directory( '2010-2011' )
    assert_equal '2010-11',       SeasonUtils.directory( '2010/11' )
    assert_equal '2010-11',       SeasonUtils.directory( '2010/2011' )
    assert_equal '2010',          SeasonUtils.directory( '2010' )

    assert_equal '2010s/2010-11', SeasonUtils.directory( '2010-11',   format: 'long' )
    assert_equal '2010s/2010-11', SeasonUtils.directory( '2010-2011', format: 'long' )
    assert_equal '2010s/2010',    SeasonUtils.directory( '2010',      format: 'long' )

    assert_equal '1999-00',       SeasonUtils.directory( '1999-00' )
    assert_equal '1999-00',       SeasonUtils.directory( '1999-2000' )
    assert_equal '1990s/1999-00', SeasonUtils.directory( '1999-00',   format: 'long' )
    assert_equal '1990s/1999-00', SeasonUtils.directory( '1999-2000', format: 'long' )
  end  # method test_diretory

end # class TestSeasonlUtils

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sportdb-config-0.4.1 test/test_season_utils.rb