]>
Commit | Line | Data |
---|---|---|
a97b490d MG |
1 | #!/usr/bin/perl |
2 | use v5.14; | |
3 | use warnings; | |
4 | ||
5 | use List::Util qw/first/; | |
6 | use WWW::Search::Test; | |
7 | ||
ff5b31da | 8 | use Test::RequiresInternet qw/www.coveralia.com 80/; |
a97b490d MG |
9 | use Test::More tests => 9; |
10 | ||
11 | tm_new_engine('Coveralia::Artists'); | |
12 | tm_run_test_no_approx(normal => $WWW::Search::Test::bogus_query, 0, 0); | |
13 | tm_run_test_no_approx(normal => 'Metallica', 1, 10); | |
14 | my $result = first { $_->title eq 'Metallica' } $WWW::Search::Test::oSearch->results; | |
15 | my @albums = $result->albums; | |
16 | ||
17 | $result = first { $_->title eq 'And Justice For All' } @albums; | |
18 | is $result->year, 1988, 'And Justice For All was released in 1988'; | |
19 | my %acovers = $result->covers; | |
20 | ok $acovers{frontal}, 'And Justice For All has a front cover'; |