74b243df364ef4b5346ce15f40cb7ad51d1f2cfd
[catagits/Catalyst-Authentication-Store-DBIx-Class.git] / t / 10-user-autoload.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use Catalyst::Authentication::Store::DBIx::Class::User;
5
6 my $message = 'I exist';
7
8 {
9   package My::Test;
10
11   sub exists { $message }
12 }
13
14 my $o = bless({
15   _user => bless({}, 'My::Test'),
16 }, 'Catalyst::Authentication::Store::DBIx::Class::User');
17
18 is($o->exists, $message, 'AUTOLOAD proxies ok');
19
20 ok(my $meth = $o->can('exists'), 'can returns true');
21
22 is($o->$meth, $message, 'can returns right coderef');
23
24 is($o->can('non_existent_method'), undef, 'can on non existent method returns undef');
25
26 done_testing;