X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FWebService-Strike.t;h=e3a86eb3f69fe95ddfe4e4f08be1b9e6963b5009;hb=0f6b165a7734099f766fefd44739d0fbf7ae4771;hp=7b7a98441de49a091433b2965d8cea71ef9a5e83;hpb=d932afd835dfedc68511a0b80cc84d5fd0eac91d;p=webservice-strike.git diff --git a/t/WebService-Strike.t b/t/WebService-Strike.t index 7b7a984..e3a86eb 100644 --- a/t/WebService-Strike.t +++ b/t/WebService-Strike.t @@ -4,28 +4,28 @@ use warnings; use Data::Dumper qw/Dumper/; use Test::RequiresInternet qw/getstrike.net 443/; -use Test::More tests => 10; +use Test::More skip_all => 'The Strike API was discontinued, therefore this test is disabled'; +use Test::More tests => 8; use Try::Tiny; BEGIN { use_ok('WebService::Strike') }; my ($t1, $t2, $t3); try { - ($t1, $t2, $t3) = strike qw/B425907E5755031BDA4A8D1B6DCCACA97DA14C04 5D4FD5A64E436A831383773F85FB38B888B9ECC9 85DF191A921C20B2DDAFF72368CAB93BA18C5ACE/; + ($t1, $t2, $t3) = strike qw/66FC47BF95D1AA5ECA358F12C70AF3BA5C7E8F9A 5D4FD5A64E436A831383773F85FB38B888B9ECC9 B425907E5755031BDA4A8D1B6DCCACA97DA14C04/; } catch { diag 'Error while calling strike:', "\n", Dumper $_ }; subtest 'order' => sub { plan tests => 3; - is $t1->hash, 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04', 'hash #1'; + is $t1->hash, '66FC47BF95D1AA5ECA358F12C70AF3BA5C7E8F9A', 'hash #1'; is $t2->hash, '5D4FD5A64E436A831383773F85FB38B888B9ECC9', 'hash #2'; - is $t3->hash, '85DF191A921C20B2DDAFF72368CAB93BA18C5ACE', 'hash #3' + is $t3->hash, 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04', 'hash #3' }; -is $t1->date, 1420502400, 'date'; +is $t1->date, 1439319419, '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'; +like $t2->description, qr#FreeBSD#, 'description contains FreeBSD'; try { strike 'aaa'; @@ -41,5 +41,13 @@ try { is $_->{status}, 404, "search for nosuchstring$$ returned 404" }; -my $p = strike_search 'Perl', 1; -is @{$p->file_names}, $p->count, 'file_names has count elements'; +# Test disabled as it fails due to the API returning bad results +#my $p = strike_search 'Perl', 1; +#say STDERR $p->hash; +# +#is @{$p->file_names}, $p->count, 'file_names has count elements'; + +# Test disabled as I can't find a torrent with an IMDB ID. Presumably +# this feature of the API is broken. +#my $imdb = strike('ED70C185E3E3246F30B2FDB08D504EABED5EEA3F')->imdb; +#is $imdb->{title}, 'The Walking Dead', 'imdb title';