Subject: | [PATCH] skip tests if your DNS server gives A records for anything (like OpenDNS) |
Date: | Fri, 1 Jun 2007 11:46:19 -0700 |
To: | bug-www-mechanize [...] rt.cpan.org, "Andy Lester" <andy [...] petdance.com> |
From: | "Tatsuhiko Miyagawa" <miyagawa [...] gmail.com> |
=== t/autocheck.t
==================================================================
--- t/autocheck.t (revision 6785)
+++ t/autocheck.t (local)
@@ -7,6 +7,12 @@
use constant NONEXISTENT => 'http://blahblablah.xx-nonexistent.';
BEGIN {
+ if (gethostbyname('blahblahblah.xx-nonexistent.')) {
+ plan skip_all => 'Found an A record for the non-existent domain';
+ }
+}
+
+BEGIN {
eval 'use Test::Exception';
plan skip_all => 'Test::Exception required to test autocheck' if $@;
plan tests => 5;
=== t/local/failure.t
==================================================================
--- t/local/failure.t (revision 6785)
+++ t/local/failure.t (local)
@@ -2,11 +2,18 @@
use warnings;
use strict;
-use Test::More tests => 16;
+use Test::More;
use lib 't/local';
use LocalServer;
+BEGIN {
+ if (gethostbyname('blahblahblah.xx-only-testing.')) {
+ plan skip_all => 'Found an A record for the non-existent domain';
+ }
+ plan tests => 16;
+}
+
BEGIN { delete @ENV{ qw( http_proxy HTTP_PROXY ) }; }
BEGIN {
use_ok( 'WWW::Mechanize' );
--
Tatsuhiko Miyagawa