X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Fpsgi-log.t;h=91a36dcd6d7deab93e331db31da713dbf175e631;hp=e010d076c39d3fc06f4a21da1bde13f0a37e49c7;hb=cc7738c0fb5c4b5dc601734e7b525391d81d6639;hpb=93c35f02b80d64aefb87db79ba40951bdcb84356 diff --git a/t/psgi-log.t b/t/psgi-log.t index e010d07..91a36dc 100644 --- a/t/psgi-log.t +++ b/t/psgi-log.t @@ -46,6 +46,8 @@ use HTTP::Request::Common; no Moose; } +my $cmp = TestApp->debug ? '>=' : '=='; + #subtest "psgi.errors" => sub { @@ -67,10 +69,10 @@ use HTTP::Request::Common; test_psgi $app, sub { my $cb = shift; - my $res = $cb->(GET "/log/debug"); + my $res = $cb->(GET "/log/info"); my @logs = $handle->logs; - is(scalar(@logs), 1, "psgi.errors: one event output"); - like($logs[0], qr/debug$/, "psgi.errors: event matches test data"); + cmp_ok(scalar(@logs), $cmp, 1, "psgi.errors: one event output"); + like($logs[0], qr/info$/m, "psgi.errors: event matches test data") unless TestApp->debug; }; }; @@ -95,9 +97,10 @@ use HTTP::Request::Common; test_psgi $app, sub { my $cb = shift; - my $res = $cb->(GET "/log/debug"); - is(scalar(@logs), 1, "psgix.logger: one event logged"); - is_deeply($logs[0], { level => 'debug', message => "debug" }, "psgix.logger: right stuff"); + my $res = $cb->(GET "/log/info"); + cmp_ok(scalar(@logs), $cmp, 1, "psgix.logger: one event logged"); + is(scalar(grep { $_->{level} eq 'info' and $_->{message} eq 'info' } @logs), + 1, "psgix.logger: right stuff"); }; };