Bug 16649: Make OpenLibrarySearch test pass even if launches offline
Test plan: prove t/OpenLibrarySearch.t should return green even if you are offline Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Signed-off-by: Galen Charlton <gmcharlt@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
b9b4eeb849
commit
f97626271e
1 changed files with 7 additions and 3 deletions
|
@ -22,7 +22,11 @@ use Test::More tests => 1;
|
|||
use LWP::Simple;
|
||||
use JSON;
|
||||
my $content = get("https://openlibrary.org/search.json?q=9780201038095");
|
||||
my $data = from_json($content);
|
||||
my $numFound = $data->{numFound};
|
||||
|
||||
ok( $numFound > 0, "The openlibrary ws should return at least 1 result" );
|
||||
SKIP: {
|
||||
skip "json has not been retrieved from openlibrary.org", 1 unless defined $content;
|
||||
my $data = from_json($content);
|
||||
my $numFound = $data->{numFound};
|
||||
|
||||
ok( $numFound > 0, "The openlibrary ws should return at least 1 result" );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue