7fbada86f335b10579a8722957a00d43fe752371
[www-search-coveralia.git] / t / albums.t
1 #!/usr/bin/perl
2 use v5.14;
3 use warnings;
4
5 use List::Util qw/first/;
6 use WWW::Search::Test;
7
8 use Test::More tests => 11;
9
10 tm_new_engine('Coveralia::Albums');
11 tm_run_test_no_approx(normal => $WWW::Search::Test::bogus_query, 0, 0);
12 tm_run_test_no_approx(normal => 'And Justice For All', 1, 10);
13 my $result = first { $_->artist eq 'Metallica' } $WWW::Search::Test::oSearch->results;
14 is $result->year, 1988, 'And Justice For All was released in 1988';
15
16 my @songs = $result->songs;
17 my %covers = $result->covers;
18 ok ((first { $_->{name} eq 'The Shortest Straw' } @songs), 'And Justice For All contains The Shortest Straw');
19 ok $covers{frontal}, 'And Justice For All has a front cover';
20 is $result->cover('frontal'), $covers{frontal}, '->cover works';
This page took 0.023636 seconds and 3 git commands to generate.