From f97626271ecf7ea90724cd7b131cf4eabb883c23 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 4 Jun 2016 12:26:27 +0100 Subject: [PATCH] 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 Signed-off-by: Mirko Tietgen Signed-off-by: Galen Charlton Signed-off-by: Kyle M Hall --- t/OpenLibrarySearch.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/t/OpenLibrarySearch.t b/t/OpenLibrarySearch.t index 8084453501..b0865e618b 100644 --- a/t/OpenLibrarySearch.t +++ b/t/OpenLibrarySearch.t @@ -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" ); +} -- 2.39.5