Skip to content
Browse files

added SKIPs

  • Loading branch information...
1 parent c50049d commit 83e3001471b1b4208f0bb7e586f642665ba580bd @barbie barbie committed Apr 13, 2012
Showing with 30 additions and 10 deletions.
  1. +3 −0 Changes
  2. +2 −2 META.json
  3. +2 −2 META.yml
  4. +1 −1 lib/CPAN/Testers/WWW/Reports/Query/Reports.pm
  5. +22 −5 t/10query.t
View
3 Changes
@@ -1,5 +1,8 @@
Revision history for CPAN-Testers-WWW-Reports-Query-Reports
+0.06 13/04/2012
+ - added skips in the event the site is down.
+
0.05 09/04/2012
- better error handling.
View
4 META.json
@@ -1,6 +1,6 @@
{
"name": "CPAN-Testers-WWW-Reports-Query-Reports",
- "version": "0.05",
+ "version": "0.06",
"abstract": "Retrieve CPAN Testers metadata direct from the CPAN Testers website",
"author": [
"Barbie (BARBIE) <barbie@cpan.org>"
@@ -44,7 +44,7 @@
"provides": {
"CPAN::Testers::WWW::Reports::Query::Reports": {
"file": "lib/CPAN/Testers/WWW/Reports/Query/Reports.pm",
- "version": "0.05"
+ "version": "0.06"
}
},
"no_index": {
View
4 META.yml
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: CPAN::Testers::WWW::Reports::Query::Reports
-version: 0.05
+version: 0.06
abstract: Retrieve CPAN Testers metadata direct from the CPAN Testers website.
author:
- Barbie <barbie@cpan.org>
@@ -24,7 +24,7 @@ build_requires:
provides:
CPAN::Testers::WWW::Reports::Query::Reports:
file: lib/CPAN/Testers/WWW/Reports/Query/Reports.pm
- version: 0.05
+ version: 0.06
resources:
repository: http://github.com/barbie/cpan-testers-www-reports-query-reports
View
2 lib/CPAN/Testers/WWW/Reports/Query/Reports.pm
@@ -3,7 +3,7 @@ package CPAN::Testers::WWW::Reports::Query::Reports;
use strict;
use warnings;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
#----------------------------------------------------------------------------
View
27 t/10query.t
@@ -84,7 +84,7 @@ my @args = (
);
my $query = CPAN::Testers::WWW::Reports::Query::Reports->new();
-isa_ok($query,'CPAN::Testers::WWW::Reports::Query::Reports','.. got response');
+isa_ok($query,'CPAN::Testers::WWW::Reports::Query::Reports');
SKIP: {
skip "Network unavailable", 13 if(pingtest());
@@ -95,8 +95,13 @@ SKIP: {
if($data && $args->{results}) {
is($data->{$_},$args->{results}{$_},".. got '$_' in date hash [$args->{date}]") for(keys %{$args->{results}});
} elsif($args->{results}) {
- diag($query->error());
- ok($query->error);
+ my $skip = $args->{results} ? scalar(keys %{$args->{results}}) : 0;
+ SKIP: {
+ skip "No response from request, site may be down", $skip;
+
+ #diag($query->error());
+ if($args->{results}) { ok(1) for(keys %{$args->{results}}) }
+ }
} else {
is($data, undef,".. got no results, as expected [$args->{date}]");
}
@@ -119,8 +124,20 @@ SKIP: {
cmp_ok(scalar @keys, '<=', $args->{count},".. counted number of records [$args->{range}]");
}
} else {
- diag($query->error());
- ok($query->error);
+ my $skip = $args->{results} ? scalar(keys %{$args->{results}}) : 0;
+ for(qw(start stop count)) {
+ $skip++ if($args->{$_});
+ }
+
+ SKIP: {
+ skip "No response from request, site may be down", $skip;
+
+ #diag($query->error());
+ if($args->{results}) { ok(1) for(keys %{$args->{results}}) }
+ ok(1) if($args->{start});
+ ok(1) if($args->{stop});
+ ok(1) if($args->{count});
+ }
}
} else {
ok(0,'missing date or range test');

0 comments on commit 83e3001

Please sign in to comment.
Something went wrong with that request. Please try again.