The t/live/get.t test script dies if Test::LongString is not installed.
The attached patch adds SKIP block around the two tests that require
Test::LongString.
Subject: | t_live_get.patch |
Index: t/live/get.t
===================================================================
--- t/live/get.t (révision 3706)
+++ t/live/get.t (copie de travail)
@@ -3,8 +3,10 @@
use warnings;
use strict;
use Test::More tests => 26;
-use Test::LongString;
+eval { require Test::LongString; };
+my $no_TLS = $@;
+
BEGIN {
use_ok( 'WWW::Mechanize' );
}
@@ -34,15 +36,24 @@
is( $agent->uri, 'http://www.google.com/help/basics.html', "Got relative OK" );
ok( $agent->is_html, "Basics page is HTML" );
is( $agent->title, "Google Help : Basics of Search", "Title matches" );
-like_string( $agent->content, qr/Essentials of Google Search/, "Got the right page" );
+SKIP: {
+ skip "Test::LongString required to test against long strings", 1 if $no_TLS;
+ like_string( $agent->content, qr/Essentials of Google Search/, "Got the right page" );
+}
+
ok( $agent->get( './refinesearch.html' )->is_success, 'Got the "refine search" page' );
is( $agent->uri, 'http://www.google.com/help/refinesearch.html', "Got relative OK" );
ok( $agent->is_html, "Refine Search page is HTML" );
is( $agent->title, "Google Help : Advanced Search" );
-like_string( $agent->content, qr/Advanced Search Made Easy/, "Got the right page" );
SKIP: {
+ skip "Test::LongString required to test against long strings", 1
+ if $no_TLS;
+ like_string( $agent->content, qr/Advanced Search Made Easy/, "Got the right page");
+}
+
+SKIP: {
eval "use Test::Memory::Cycle";
skip "Test::Memory::Cycle not installed", 1 if $@;