only import Test::Exception where it is needed
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppCompat / Controller / Root.pm
1 package AuthRealmTestAppCompat::Controller::Root;
2 use warnings;
3 use strict;
4 use base qw/Catalyst::Controller/;
5
6 __PACKAGE__->config( namespace => '' );
7
8 use Test::More;
9
10 sub moose : Local {
11     my ( $self, $c ) = @_;
12
13     while ( my ($user, $info) = each %$AuthRealmTestAppCompat::members ) {
14
15         my $ok = eval {
16             $c->authenticate(
17                 { username => $user, password => $info->{password} },
18                 'members'
19             ),
20         };
21
22         ok( !$@,                "Test did not die: $@" );
23         ok( $ok,                "user $user authentication" );
24     }
25
26     $c->res->body( "ok" );
27 }
28
29 1;
30