From: Marius Gavrilescu Date: Sun, 18 Aug 2013 07:39:52 +0000 (+0300) Subject: More tests X-Git-Tag: 0.002~4 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=238670541686b36bd6f4698f9fb3c091660f9b34;p=app-musicexpo.git More tests --- diff --git a/t/App-MusicExpo.t b/t/App-MusicExpo.t index 6dfc455..0ad611b 100644 --- a/t/App-MusicExpo.t +++ b/t/App-MusicExpo.t @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -wT -CSDA use v5.14; use warnings; diff --git a/t/musicexpo-cache.t b/t/musicexpo-cache.t new file mode 100644 index 0000000..635f671 --- /dev/null +++ b/t/musicexpo-cache.t @@ -0,0 +1,41 @@ +#!/usr/bin/perl -wT -CSDA +use v5.14; +use warnings; + +use Test::More tests => 3; + +use File::Temp qw/tempfile/; +use DB_File; +use Storable qw/thaw/; + +my $file; + +BEGIN { + $file = (tempfile UNLINK => 1)[1]; + @ARGV = (-cache => $file, 'empty.flac', 'empty.mp3'); +} +BEGIN { use_ok('App::MusicExpo'); } + +close STDOUT; +my $out; +open STDOUT, '>', \$out; + +App::MusicExpo->run; + +is $out, <<'OUT', 'output is correct'; + +Music + + + + + + +
TitleArtistAlbumGenreTrackYearType +
CelluleSilenceL'autre endroitElectro01/092005FLAC +
CelluleSilenceL'autre endroitElectro01/092005MP3 +
+OUT + +ok -e $file, 'cache exists'; +tie my %db, DB_File => $file; diff --git a/t/musicexpo.t b/t/musicexpo.t new file mode 100644 index 0000000..b2f133c --- /dev/null +++ b/t/musicexpo.t @@ -0,0 +1,28 @@ +#!/usr/bin/perl -wT -CSDA +use v5.14; +use warnings; + +use Test::More tests => 2; + +use Storable qw/thaw/; + +BEGIN { use_ok('App::MusicExpo'); } + +close STDOUT; +my $out; +open STDOUT, '>', \$out; + +App::MusicExpo->run; + +is $out, <<'OUT', 'output is correct'; + +Music + + + + + + +
TitleArtistAlbumGenreTrackYearType +
+OUT