Make mech tests skip unless mech new enough. RT#55303
Tomas Doran [Sat, 8 May 2010 20:36:44 +0000 (20:36 +0000)]
Changes
Makefile.PL
t/live_app.t
t/live_app_digest.t

diff --git a/Changes b/Changes
index 5d23d37..5808703 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+   - Skip WWW::Mech tests unless WWW::Mech is a new enough version (RT#55303).
+
 1.012 2010-03-07
    - Move actions out of the test applications to stop warnings.
 
index 40c9275..1b7ce66 100644 (file)
@@ -14,6 +14,7 @@ requires 'Test::MockObject';
 requires 'URI::Escape';
 requires 'Class::Accessor::Fast';
 
+author_requires 'Test::WWW::Mechanize::Catalyst' => '0.51';
 author_requires 'Test::Pod' => '1.14';
 author_requires 'Test::Spelling' => '0.11';
 author_requires 'Test::Pod::Coverage' => '1.04';
index 142c406..fc07156 100644 (file)
@@ -7,7 +7,11 @@ use lib "$Bin/lib";
 
 use Test::More;
 BEGIN {
-    eval { require Test::WWW::Mechanize::Catalyst }
+    do {
+        eval { require Test::WWW::Mechanize::Catalyst }
+        and
+        Test::WWW::Mechanize::Catalyst->VERSION('0.51')
+    }
       or plan skip_all =>
       "Test::WWW::Mechanize::Catalyst is needed for this test";
     plan tests => 4;
index 50f2247..2755f3c 100644 (file)
@@ -5,7 +5,11 @@ use FindBin qw/$Bin/;
 use lib "$Bin/lib";
 use Test::More;
 BEGIN {
-    eval { require Test::WWW::Mechanize::Catalyst }
+    do {
+        eval { require Test::WWW::Mechanize::Catalyst }
+        and
+        Test::WWW::Mechanize::Catalyst->VERSION('0.51')
+    }
       or plan skip_all =>
       "Test::WWW::Mechanize::Catalyst is needed for this test";
     eval { require Catalyst::Plugin::Cache }