Permalink
Browse files

Skip some tests if Test::WWW::Mechanize is not available

  • Loading branch information...
chorny committed Oct 6, 2010
1 parent 4fbf7eb commit 4b31f92e712f8b7c34ddaa86b7b688ff4484e45d
Showing with 16 additions and 4 deletions.
  1. +2 −0 Changes
  2. +8 −2 t/02-create.t
  3. +6 −2 t/03-verify.t
View
@@ -1,5 +1,7 @@
Revision history for CGI-Application-Plugin-CAPTCHA
+ Skip some tests if Test::WWW::Mechanize is not available (RT#17146, by ZACKSE)
+
0.01 Date/time
First version, released on an unsuspecting world.
View
@@ -2,8 +2,14 @@
use strict;
use warnings;
-use Test::More tests => 4;
-use Test::WWW::Mechanize;
+use Test::More;
+
+BEGIN {
+ eval "use Test::WWW::Mechanize";
+ plan skip_all => "Test::WWW::Mechanize required for tests" if $@;
+}
+
+plan tests => 4;
# Bring in testing hierarchy
use lib './t';
View
@@ -2,8 +2,12 @@
use strict;
use warnings;
-use Test::More tests => 7;
-use Test::WWW::Mechanize;
+BEGIN {
+ eval "use Test::WWW::Mechanize";
+ plan skip_all => "Test::WWW::Mechanize required for tests" if $@;
+}
+
+plan tests => 7;
# Bring in testing hierarchy
use lib './t';

0 comments on commit 4b31f92

Please sign in to comment.