]> iEval git - app-musicexpo.git/blob - t/musicexpo-cache.t
Update the default format
[app-musicexpo.git] / t / musicexpo-cache.t
1 #!/usr/bin/perl -wT
2 use v5.14;
3 use warnings;
4
5 use Test::More tests => 3;
6
7 use File::Temp qw/tempfile/;
8 use DB_File;
9 use Storable qw/thaw/;
10
11 my $file;
12
13 BEGIN {
14 $file = (tempfile UNLINK => 1)[1];
15 @ARGV = (-cache => $file, 'empty.flac', 'empty.mp3');
16 }
17 BEGIN { use_ok('App::MusicExpo'); }
18
19 close STDOUT;
20 my $out;
21 open STDOUT, '>', \$out;
22
23 App::MusicExpo->run;
24
25 is $out, <<'OUT', 'output is correct';
26 <!DOCTYPE html>
27 <title>Music</title>
28 <meta charset="utf-8">
29 <link rel="stylesheet" href="/music.css">
30
31 <table border>
32 <thead>
33 <tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
34 <tbody>
35 <tr><td><a href="%2Fmusic%2Fempty.flac">Cellule</a><td>Silence<td>L&#39;autre endroit<td>Electro<td>01/09<td>2005<td>FLAC
36 <tr><td><a href="%2Fmusic%2Fempty.mp3">Cellule</a><td>Silence<td>L&#39;autre endroit<td>Electro<td>01/09<td>2005<td>MP3
37 </table>
38 OUT
39
40 ok -e $file, 'cache exists';
41 tie my %db, DB_File => $file;
This page took 0.04603 seconds and 4 git commands to generate.