1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Author: Nicholas Bamber <nicholas@periapt.co.uk>
Subject: skipping tests that depend on the netork
Forwarded: not-needed
Last-Update: 2011-11-24
--- a/t/metamark.t
+++ b/t/metamark.t
@@ -2,6 +2,9 @@
BEGIN { use_ok WWW::Shorten::Metamark };
+SKIP: {
+ skip 'network testing turned off by default', 6 if not $ENV{NETWORK_TESTING};
+
my $url = 'http://dave.org.uk/';
my $short = makeashorterlink( $url );
ok((defined $short), 'Reasonable response');
@@ -16,3 +19,5 @@
ok($@);
eval { &makealongerlink() };
ok($@);
+
+}
--- a/t/tinyurl.t
+++ b/t/tinyurl.t
@@ -2,6 +2,11 @@
BEGIN { use_ok WWW::Shorten::TinyURL };
+SKIP: {
+ skip 'network testing turned off by default', 5 if not $ENV{NETWORK_TESTING};
+
+my $url = 'http://dave.org.uk/';
+
my $url = 'http://search.cpan.org/dist/WWW-Shorten/';
my $return = makeashorterlink($url);
my ($code) = $return =~ /(\w+)$/;
@@ -14,3 +19,5 @@
ok($@, 'makeashorterlink fails with no args');
eval { &makealongerlink() };
ok($@, 'makealongerlink fails with no args');
+
+}
|