X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FWebService-Strike.t;h=19e4162a37cb2d2cfd87ed32ebb1f5c366acac3c;hb=a33f0562be81e017147b852c2bcd8217250df45d;hp=42825e19196a469ed639a02d937b50487f544db1;hpb=9373f0ade1d99182c2ef4205a94e2e054903cb0c;p=webservice-strike.git diff --git a/t/WebService-Strike.t b/t/WebService-Strike.t index 42825e1..19e4162 100644 --- a/t/WebService-Strike.t +++ b/t/WebService-Strike.t @@ -2,23 +2,30 @@ use strict; use warnings; -use Test::RequiresInternet qw/getstrike.net 80/; -use Test::More tests => 9; +use Data::Dumper qw/Dumper/; +use Test::RequiresInternet qw/getstrike.net 443/; +use Test::More tests => 11; use Try::Tiny; BEGIN { use_ok('WebService::Strike') }; -my ($t1, $t2, $t3) = strike qw/B425907E5755031BDA4A8D1B6DCCACA97DA14C04 5D4FD5A64E436A831383773F85FB38B888B9ECC9 85DF191A921C20B2DDAFF72368CAB93BA18C5ACE/; +my ($t1, $t2, $t3); +try { + ($t1, $t2, $t3) = strike qw/B425907E5755031BDA4A8D1B6DCCACA97DA14C04 5D4FD5A64E436A831383773F85FB38B888B9ECC9 ED70C185E3E3246F30B2FDB08D504EABED5EEA3F/; +} catch { + diag 'Error while calling strike:', "\n", Dumper $_ +}; subtest 'order' => sub { plan tests => 3; is $t1->hash, 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04', 'hash #1'; is $t2->hash, '5D4FD5A64E436A831383773F85FB38B888B9ECC9', 'hash #2'; - is $t3->hash, '85DF191A921C20B2DDAFF72368CAB93BA18C5ACE', 'hash #3' + is $t3->hash, 'ED70C185E3E3246F30B2FDB08D504EABED5EEA3F', 'hash #3' }; is $t1->date, 1420502400, 'date'; is $t2->title, 'FreeBSD 7.1 i386.DVD.iso', 'title'; like $t1->torrent, qr/^d/, 'torrent file starts with d'; +like $t1->description, qr#GNU/Linux#, 'description contains GNU/Linux'; try { strike 'aaa'; @@ -36,3 +43,6 @@ try { my $p = strike_search 'Perl', 1; is @{$p->file_names}, $p->count, 'file_names has count elements'; + +my $imdb = strike('ED70C185E3E3246F30B2FDB08D504EABED5EEA3F')->imdb; +is $imdb->{title}, 'The Walking Dead', 'imdb title';