]> iEval git - webservice-strike.git/blobdiff - t/WebService-Strike.t
Use HTTPS and include diagnostics in test
[webservice-strike.git] / t / WebService-Strike.t
index ce3c39e20a4f947bf3e29d845504b01b0e1a8305..7713555614d44afcd20e1aa777f9a2d6c55a90a1 100644 (file)
@@ -2,12 +2,18 @@
 use strict;
 use warnings;
 
-use Test::RequiresInternet qw/getstrike.net 80/;
-use Test::More tests => 6;
+use Data::Dumper qw/Dumper/;
+use Test::RequiresInternet qw/getstrike.net 443/;
+use Test::More tests => 9;
 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 85DF191A921C20B2DDAFF72368CAB93BA18C5ACE/;
+} catch {
+       diag 'Error while calling strike:', "\n", Dumper $_
+};
 
 subtest 'order' => sub {
        plan tests => 3;
@@ -25,3 +31,14 @@ try {
 } catch {
        is $_->{status}, 404, 'non-existent torrent status is 404';
 };
+
+my @debian = strike_search 'Debian';
+ok @debian > 10, 'search for Debian returned more than 10 results';
+try {
+       strike_search "nosuchstring$$";
+} catch {
+       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';
This page took 0.023989 seconds and 4 git commands to generate.