Sha256: 784cfb3ddd638d5ab7519ca5e006292a18507dc64e2f8ef1ab6a6e8b29a49802
Contents?: true
Size: 1.38 KB
Versions: 7
Compression:
Stored size: 1.38 KB
Contents
# encoding: utf-8 ### # to run use # ruby -I ./lib -I ./test test/test_datafile_package.rb require 'helper' class TestDatafilePackage < MiniTest::Test def test_read [Datafile::DirPackage.new( '../../../openfootball/england' ), Datafile::ZipPackage.new( 'tmp/england-master.zip' ) ].each do |eng| assert eng.find( '2015-16/.conf.txt' ).read.start_with?( '= English Premier League 2015/16' ) assert eng.find( '2017-18/.conf.txt' ).read.start_with?( '= English Premier League 2017/18' ) assert eng.find( '2015-16/1-premierleague-i.txt' ).read.start_with?( '= English Premier League 2015/16' ) end [Datafile::DirPackage.new( '../../../openfootball/austria' ), Datafile::ZipPackage.new( 'tmp/austria-master.zip' ) ].each do |at| assert at.find( '2018-19/.conf.txt' ).read.start_with?( '= Ă–sterr. Bundesliga 2018/19' ) end puts "DirPackage:" pack = Datafile::DirPackage.new( '../../../openfootball/austria' ) puts pack.name puts " entries:" pack.each( pattern: /\.txt$/ ) do |entry| puts entry.name end puts "ZipPackage:" pack = Datafile::ZipPackage.new( 'tmp/austria-master.zip' ) puts pack.name puts " entries:" pack.each( pattern: /\.txt$/ ) do |entry| puts entry.name end end # method test_read end # class TestDatafilePackage
Version data entries
7 entries across 7 versions & 1 rubygems