X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbackend.t;h=9fe0d0e35522cf1202e303a49bde29140a09650f;hb=cedb9fb4ae54e24ead346e95e1a9f574ea543eb8;hp=68347187f710d2d3f7922f67fb9fea9b67c7d966;hpb=3e0bbcff879384a81c842abcede0dba6b4314790;p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git diff --git a/t/backend.t b/t/backend.t index 6834718..9fe0d0e 100644 --- a/t/backend.t +++ b/t/backend.t @@ -3,8 +3,7 @@ use strict; use warnings; -use Test::More 'no_plan'; -use Path::Class; +use Test::More tests => 19; use File::Temp qw/tempfile/; @@ -16,14 +15,12 @@ my $passwd = Authen::Htpasswd->new($tmp); $passwd->add_user("user", "s3cr3t"); - can_ok($m, "new"); isa_ok(my $o = $m->new( $passwd ), $m); can_ok($m, "file"); isa_ok( $o->file, "Authen::Htpasswd"); - can_ok( $m, "user_supports"); ok( $m->user_supports(qw/password self_check/), "user_supports self check" ); @@ -37,4 +34,13 @@ ok( $u->supports(qw/password self_check/), "htpasswd users check their own passw can_ok( $u, "check_password"); ok( $u->check_password( "s3cr3t" ), "password is s3cr3t"); +ok( $m->user_supports(qw/session/), "user_supports session"); + +is( $u->store, $o, "can get store"); + +can_ok( $m, "from_session" ); +can_ok( $u, "for_session" ); + +my $recovered = $u->store->from_session( undef, $u->for_session ); +is( $recovered->username, $u->username, "recovery from session works");