- Fix spelling, grammar and structural errors in POD
- Remove redundant ->setup call in t/head_middleware.t RT#95361
+ - Fix test failures when running under CATALYST_DEBUG. RT#95358
5.90064 - 2014-05-05
- Fix for mindless broken tests on Win32 (Haarg++).
'HEAD method content is empty' );
}
elsif ( $method eq 'GET' ) {
- # method name is echo'd back in content-body, which
- # accounts for difference in content length. In normal
+ # method name is echo'd back in content-body (twice under debug),
+ # which accounts for difference in content length. In normal
# cases the Content-Length should be the same regardless
# of whether it's a GET or HEAD request.
SKIP:
if ( $ENV{CATALYST_SERVER} ) {
skip "Using remote server", 2;
}
+ my $diff = TestApp->debug ? 2 : 1;
is( $response->header('Content-Length'),
- $content_length - 1, 'Response Header Content-Length' );
+ $content_length - $diff, 'Response Header Content-Length' )
+ or diag $response->content;
is( length($response->content),
$response->header('Content-Length'),
'GET method content' );
use warnings;
our @LOGS;
+our @ILOGS;
our @ELOGS;
sub new {
push(@LOGS, shift());
}
+sub info {
+ shift;
+ push(@ILOGS, shift());
+}
+
sub warn {
shift;
push(@ELOGS, shift());
no Moose;
}
+my $cmp = TestApp->debug ? '>=' : '==';
+
#subtest "psgi.errors" => sub
{
my $cb = shift;
my $res = $cb->(GET "/log/debug");
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/debug$/m, "psgi.errors: event matches test data");
};
};
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");
+ cmp_ok(scalar(@logs), $cmp, 1, "psgix.logger: one event logged");
+ is(scalar(grep { $_->{level} eq 'debug' and $_->{message} eq 'debug' } @logs),
+ 1, "psgix.logger: right stuff");
};
};