From 238670541686b36bd6f4698f9fb3c091660f9b34 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 18 Aug 2013 10:39:52 +0300 Subject: [PATCH] More tests --- t/App-MusicExpo.t | 2 +- t/musicexpo-cache.t | 41 +++++++++++++++++++++++++++++++++++++++++ t/musicexpo.t | 28 ++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 t/musicexpo-cache.t create mode 100644 t/musicexpo.t 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 -- 2.30.2