Skip to content

Commit

Permalink
added SKIPs
Browse files Browse the repository at this point in the history
  • Loading branch information
barbie committed Apr 13, 2012
1 parent c50049d commit 83e3001
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 2 additions & 2 deletions META.json
Original file line number Diff line number Diff line change
@@ -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>"
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions META.yml
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/CPAN/Testers/WWW/Reports/Query/Reports.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package CPAN::Testers::WWW::Reports::Query::Reports;
use strict;
use warnings;

our $VERSION = '0.05';
our $VERSION = '0.06';

#----------------------------------------------------------------------------

Expand Down
27 changes: 22 additions & 5 deletions t/10query.t
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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}]");
}
Expand All @@ -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');
Expand Down

0 comments on commit 83e3001

Please sign in to comment.