Epic cleanup and code shuffle in tests to avoid warnings
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppCompat.pm
index 8ff5389..6c40ccd 100644 (file)
@@ -1,6 +1,7 @@
 package AuthRealmTestAppCompat;
 use warnings;
 use strict;
+use base qw/Catalyst/;
 
 ### using A::Store::minimal with new style realms
 ### makes the app blow up, since c::p::a::s::minimal
@@ -13,35 +14,13 @@ use Catalyst qw/
     Authentication::Store::Minimal
 /;
 
-use Test::More;
-use Test::Exception;
-
 our $members = {
     bob => {
         password => "s00p3r"
     },
 };
 
-sub moose : Local {
-       my ( $self, $c ) = @_;
-
-    while ( my ($user, $info) = each %$members ) {
-        
-        my $ok = eval {
-            $c->authenticate( 
-                { username => $user, password => $info->{password} }, 
-                'members' 
-            ), 
-        };
-        
-        ok( !$@,                "Test did not die: $@" );
-        ok( $ok,                "user $user authentication" );
-    }
-
-       $c->res->body( "ok" );
-}
-
-__PACKAGE__->config->{'Plugin::Authentication'} = {  
+__PACKAGE__->config('Plugin::Authentication' => {
     default_realm => 'members',
         members => {
             credential => {
@@ -54,7 +33,9 @@ __PACKAGE__->config->{'Plugin::Authentication'} = {
                 users => $members,
             }
         },
-    
-};
+});
 
 __PACKAGE__->setup;
+
+1;
+