version 0.56
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / two_app.t
index a54529b..edbcc27 100644 (file)
@@ -4,20 +4,23 @@ use warnings;
 use Test::More;
 use lib 't/lib';
 
-eval {
-    require Catalyst::Plugin::Session;
-    require Catalyst::Plugin::Session::State::Cookie;
-};
-
-if ($@) {
-    diag($@);
-    plan skip_all => "Need Catalyst::Plugin::Session to run this test";
-} else {
-    plan tests => 4;
+BEGIN {
+    eval {
+        require Catalyst::Plugin::Session;
+        require Catalyst::Plugin::Session::State::Cookie;
+    };
+
+    if ($@) {
+        diag($@);
+        plan skip_all => "Need Catalyst::Plugin::Session to run this test";
+        exit 0;
+    }
 }
 
 use Test::WWW::Mechanize::Catalyst;
 
+plan tests => 4;
+
 my $m1 = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'Catty');
 my $m2 = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'CattySession');