Fix broken links and malformed formatting in POD
[catagits/Catalyst-Authentication-Store-Htpasswd.git] / t / backend_md5.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 12;
7
8 use File::Temp qw/tempfile/;
9
10 my $m; BEGIN { use_ok($m = "Catalyst::Authentication::Store::Htpasswd") }
11
12 (undef, my $tmp) = tempfile();
13
14 my $passwd = Authen::Htpasswd->new($tmp, { encrypt_hash => 'md5' });
15
16 $passwd->add_user("user", "s3cr3t");
17
18 can_ok($m, "new");
19 isa_ok(my $o = $m->new( { file => $passwd } ), $m);
20
21 can_ok($m, "file");
22 isa_ok( $o->file, "Authen::Htpasswd");
23
24 can_ok( $m, "user_supports");
25 ok( $m->user_supports(qw/password self_check/), "user_supports self check" );
26
27 can_ok($m, "find_user");
28 isa_ok( my $u = $o->find_user({username  => "user"}), "Catalyst::Authentication::Store::Htpasswd::User");
29 isa_ok( $u, "Catalyst::Authentication::User");
30
31 can_ok( $u, "check_password");
32 ok( $u->check_password( "s3cr3t" ), "password is s3cr3t");
33
34
35