Jelajahi Sumber

V21 release - add a special catch for moronic cpantesters fails

George S. Baugh 10 tahun lalu
induk
melakukan
d71c2d5ee9
2 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. TEMPAT SAMPAH
      dist/TestRail-API-0.021.tar.gz
  2. 7 1
      t/TestRail-API.t

TEMPAT SAMPAH
dist/TestRail-API-0.021.tar.gz


+ 7 - 1
t/TestRail-API.t

@@ -18,7 +18,13 @@ my $pw     = $ENV{'TESTRAIL_PASSWORD'};
 my $is_mock = (!$apiurl && !$login && !$pw);
 
 like(exception {TestRail::API->new('trash');}, qr/invalid uri/i, "Non-URIs bounce constructor");
-like(exception {TestRail::API->new('http://hokum.bogus','lies','moreLies',0); }, qr/Could not communicate with TestRail Server/i,"Bogus Testrail URI rejected");
+
+#XXX for some insane reason 'hokum.bogus' seems to be popular with cpantesters
+my $bogoError = exception {TestRail::API->new('http://hokum.bogus','lies','moreLies',0); };
+SKIP: {
+    skip("Some CPANTesters like to randomly redirect all DNS misses to some other host, apparently", 1) if ($bogoError =~ m/404/);
+    like($bogoError, qr/Could not communicate with TestRail Server/i,"Bogus Testrail URI rejected");
+}
 
 SKIP: {
     skip("Testing authentication not supported with mock",2) if ($is_mock);