fix Makefile.PL when no . in @INC
[catagits/Catalyst-Plugin-Session.git] / t / live_verify_address.t
index 3b2ca71..e18ca91 100644 (file)
@@ -16,6 +16,9 @@ BEGIN {
     or plan skip_all =>
         'Test::WWW::Mechanize::PSGI is required for this test';
 
+    eval { require Catalyst::Plugin::Authentication; 1 }
+      or plan skip_all => "Catalyst::Plugin::Authentication is required for this test";
+
     plan tests => 12;
 }
 
@@ -37,18 +40,13 @@ $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
 $ua->content_contains('session variable set');
 
 
-# Change Client 
-#local $ENV{REMOTE_ADDR} = "192.168.1.2";
+# Change Client
 use Plack::Builder;
 my $app = SessionTestApp->psgi_app(@_);
-builder { 
-  enable 'ForceEnv' => REMOTE_ADDR => "192.168.1.2";
-  $app;
-};
 my $ua2 = Test::WWW::Mechanize::PSGI->new(
     app => $app,
     cookie_jar => {}
-);   
+);
 $ua2->get_ok( "http://localhost/get_session_variable/logged");
 $ua2->content_contains('VAR_logged=n.a.');
 
@@ -61,7 +59,7 @@ $ua->content_contains('logged in (without address)');
 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
 $ua->content_contains('session variable set');
 
-# Change Client 
+# Change Client
 local $ENV{REMOTE_ADDR} = "192.168.1.2";
 
 $ua->get_ok( "http://localhost/get_session_variable/logged" );