Use tags from all versions instead of only the first
[app-musicexpo.git] / t / musicexpo-cache.t
CommitLineData
8086953c 1#!/usr/bin/perl -wT
23867054
MG
2use v5.14;
3use warnings;
4
5use Test::More tests => 3;
6
7use File::Temp qw/tempfile/;
8use DB_File;
9use Storable qw/thaw/;
10
11my $file;
12
13BEGIN {
14 $file = (tempfile UNLINK => 1)[1];
15 @ARGV = (-cache => $file, 'empty.flac', 'empty.mp3');
16}
17BEGIN { use_ok('App::MusicExpo'); }
18
19close STDOUT;
20my $out;
21open STDOUT, '>', \$out;
22
23App::MusicExpo->run;
24
25is $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>
95267d4f 35<tr><td>Cellule<td>Silence<td>L&#39;autre endroit<td>Electro<td>01/09<td>2005<td><a href="/music/empty.flac">FLAC</a> <a href="/music/empty.mp3">MP3</a>
23867054 36</table>
95267d4f 37
9d6d04a4 38<pre id="json" style="display: none">{"files":[{"album":"L'autre endroit","artist":"Silence","formats":[{"file":"empty.flac","format":"FLAC"},{"file":"empty.mp3","format":"MP3"}],"genre":"Electro","title":"Cellule","tracknumber":"01","tracktotal":"09","year":"2005"}],"prefix":"/music/"}</pre>
23867054
MG
39OUT
40
41ok -e $file, 'cache exists';
42tie my %db, DB_File => $file;
This page took 0.011235 seconds and 4 git commands to generate.