Fix basic test for Test::MockObject 1.07, where it will die if a
[catagits/Catalyst-Authentication-Credential-HTTP.git] / t / basic.t
index 7bee485..1af650c 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-use Test::More tests => 12;
+use Test::More tests => 13;
 use Test::MockObject::Extends;
 use Test::MockObject;
 use Test::Exception;
@@ -24,6 +24,7 @@ my $cache = Test::MockObject->new;
 $cache->mock(set => sub { shift->{$_[0]} = $_[1] });
 $cache->mock(get => sub { return shift->{$_[0]} });
 $c->mock(cache => sub { $cache });
+$c->mock(debug => sub { 0 });
 my @login_info;
 $c->mock( login => sub { shift; @login_info = @_; 1 } );
 $c->set_always( config => {} );
@@ -40,8 +41,9 @@ lives_ok {
 $req_headers->clear;
 $c->clear;
 throws_ok {
-    $c->authorization_required;
+    $c->authorization_required( realm => "foo" );
 } qr/^ $Catalyst::DETACH $/x, "detached on no authorization required with bad auth";
 is( $status, 401, "401 status code" );
 like( ($res_headers->header('WWW-Authenticate'))[0], qr/^Digest/, "WWW-Authenticate header set: digest");
 like( ($res_headers->header('WWW-Authenticate'))[1], qr/^Basic/, "WWW-Authenticate header set: basic");
+like( ($res_headers->header('WWW-Authenticate'))[1], qr/realm=foo/, "WWW-Authenticate header set: basic with realm");