Complete rewrite to use Plack Middleware.
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 20debug.t
index 400dfcd..fe64398 100644 (file)
@@ -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');