X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F20debug.t;h=fe64398dae95c879b4b48896a05f3410c253c362;hb=refs%2Fheads%2Fplackify;hp=400dfcd46b52a52e2e326eadc8628da36de5c7f2;hpb=9e2ff94458bf57aca4fd1b52cbea640427b2af78;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/t/20debug.t b/t/20debug.t index 400dfcd..fe64398 100644 --- a/t/20debug.t +++ b/t/20debug.t @@ -16,16 +16,10 @@ TestApp->config->{'Plugin::Static::Simple'}->{dirs} = [ TestApp->config->{'Plugin::Static::Simple'}->{debug} = 1; -use Catalyst::Log; - -local *Catalyst::Log::_send_to_log; -local our @MESSAGES; +local our $MESSAGES; { - no warnings 'redefine'; - *Catalyst::Log::_send_to_log = sub { - my $self = shift; - push @MESSAGES, @_; - }; + close(STDERR); + open(STDERR, ">>", \$MESSAGES); } @@ -33,6 +27,6 @@ local our @MESSAGES; ok( my $res = request('http://localhost/always-static/404.txt'), 'request ok' ); is( $res->code, 404, '404 ok' ); is( $res->content_type, 'text/html', '404 is text/html' ); -ok(defined $MESSAGES[0], 'debug message set'); -like( $MESSAGES[0], qr/404/, 'debug message contains 404'); +ok(defined $MESSAGES, 'debug message set'); +like( $MESSAGES, qr/404/, 'debug message contains 404');