Improve tests
[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/;
23867054
MG
8
9my $file;
10
11BEGIN {
12 $file = (tempfile UNLINK => 1)[1];
a535e879 13 @ARGV = (-cache => $file, sort <empty*>);
23867054
MG
14}
15BEGIN { use_ok('App::MusicExpo'); }
16
17close STDOUT;
18my $out;
19open STDOUT, '>', \$out;
20
21App::MusicExpo->run;
22
23is $out, <<'OUT', 'output is correct';
24<!DOCTYPE html>
25<title>Music</title>
26<meta charset="utf-8">
6b125df7 27<link rel="stylesheet" href="musicexpo.css">
1fc49a0c
MG
28<script async defer type="application/javascript" src="player.js"></script>
29
30<div id="player"></div>
23867054
MG
31
32<table border>
33<thead>
34<tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
35<tbody>
a535e879
MG
36<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L&#39;autre endroit<td class="genre">Electro<td class="track">01/09<td class="year">2005<td class="formats"><a href="/music/empty.flac">FLAC</a> <a href="/music/empty.ogg">Vorbis</a>
37<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L&#39;autre endroit<td class="genre">Electro<td class="track">01/09<td class="year">2005<td class="formats"><a href="/music/empty3.mp3">MP3</a>
38<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L&#39;autre endroit<td class="genre">Electro<td class="track">1/9<td class="year">2005<td class="formats"><a href="/music/empty4.aac">AAC</a>
23867054
MG
39</table>
40OUT
41
42ok -e $file, 'cache exists';
This page took 0.01296 seconds and 4 git commands to generate.