X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_app_digest.t;h=2755f3c3dc499fdacc51e2eef7b9a1c5c9a33b87;hb=b7156dcc1860998344723c3707c812c545b26097;hp=b77d25642cadeef6eef2b4f44d9f60d89514e7c7;hpb=2dad9ca67d911fc0a6da9caf66f033e81f72c8cb;p=catagits%2FCatalyst-Authentication-Credential-HTTP.git diff --git a/t/live_app_digest.t b/t/live_app_digest.t index b77d256..2755f3c 100644 --- a/t/live_app_digest.t +++ b/t/live_app_digest.t @@ -1,9 +1,15 @@ #!/usr/bin/perl use strict; use warnings; +use FindBin qw/$Bin/; +use lib "$Bin/lib"; use Test::More; BEGIN { - eval { require Test::WWW::Mechanize::Catalyst } + do { + eval { require Test::WWW::Mechanize::Catalyst } + and + Test::WWW::Mechanize::Catalyst->VERSION('0.51') + } or plan skip_all => "Test::WWW::Mechanize::Catalyst is needed for this test"; eval { require Catalyst::Plugin::Cache } @@ -16,49 +22,8 @@ BEGIN { } use Digest::MD5; use HTTP::Request; -{ - package AuthTestApp; - use Catalyst qw/ - Authentication - Cache - /; - use Test::More; - our %users; - sub moose : Local { - my ( $self, $c ) = @_; - #$c->authenticate( { realm => 'testrealm@host.com' } ); - $c->authenticate(); - $c->res->body( $c->user->id ); - } - my $digest_pass = Digest::MD5->new; - $digest_pass->add('Mufasa2:testrealm@host.com:Circle Of Life'); - %users = ( - Mufasa => { pass => "Circle Of Life", }, - Mufasa2 => { pass => $digest_pass->hexdigest, }, - ); - __PACKAGE__->config->{cache}{backend} = { - class => 'Cache::FileCache', - }; - __PACKAGE__->config( authentication => { - default_realm => 'testrealm@host.com', - realms => { - 'testrealm@host.com' => { - store => { - class => 'Minimal', - users => \%users, - }, - credential => { - class => 'HTTP', - type => 'digest', - password_type => 'clear', - password_field => 'pass' - }, - }, - }, - }); - __PACKAGE__->setup; -} -use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/; +use Test::More; +use Test::WWW::Mechanize::Catalyst qw/AuthDigestTestApp/; sub do_test { my $username = shift;