Fix external server test.
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / cookies.t
index 823adb6..63c8ad3 100644 (file)
@@ -1,23 +1,26 @@
-#!perl -T
+#!perl
 use strict;
 use warnings;
 use lib 'lib';
 use Test::More;
 
-eval {
-    require Catalyst::Plugin::Session;
-    require Catalyst::Plugin::Session::State::Cookie;
-};
+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";
-} else {
-    plan tests => 3;
+    if ($@) {
+        diag($@);
+        plan skip_all => "Need Catalyst::Plugin::Session to run this test";
+        exit 0;
+    }
 }
 use lib 't/lib';
 use Test::WWW::Mechanize::Catalyst 'CattySession';
 
+plan tests => 3;
+
 my $m = Test::WWW::Mechanize::Catalyst->new;
 $m->credentials( 'user', 'pass' );