b12c815c70a04d46836ab251e45a5ec84a4ac703
[catagits/Catalyst-Authentication-Store-LDAP.git] / t / 06-user_autoload.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 use Catalyst::Authentication::Store::LDAP::User;
6
7 my $message = 'I exist';
8
9 {
10     package TestUser;
11     use base 'Catalyst::Authentication::Store::LDAP::User';
12     sub has_attribute {
13         return unless pop eq 'exists';
14         return $message;
15     }
16 }
17
18 my $o = bless {}, 'TestUser';
19
20 is($o->exists, $message, 'AUTOLOAD proxies ok');
21
22 ok(my $meth = $o->can('exists'), 'can returns true');
23
24 is($o->$meth, $message, 'can returns right coderef');
25
26 done_testing;;