X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F20debug.t;h=400dfcd46b52a52e2e326eadc8628da36de5c7f2;hb=ee1e7faf8d6bb43a85f6d6f74b8f0bd7b7e8712a;hp=e934deef343487ba9a7a970cd1e9bcb4663d4bc2;hpb=41cac5ef01ba7391bb7a21fd3eb25bafd4b44e70;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/t/20debug.t b/t/20debug.t index e934dee..400dfcd 100644 --- a/t/20debug.t +++ b/t/20debug.t @@ -1,38 +1,38 @@ -#!perl - -use strict; -use warnings; - -use FindBin; -use lib "$FindBin::Bin/lib"; - -use Test::More tests => 5; -use Catalyst::Test 'TestApp'; - -# test defined static dirs -TestApp->config->{static}->{dirs} = [ - 'always-static', -]; - -TestApp->config->{static}->{debug} = 1; - -use Catalyst::Log; - -local *Catalyst::Log::_send_to_log; -local our @MESSAGES; -{ - no warnings 'redefine'; - *Catalyst::Log::_send_to_log = sub { - my $self = shift; - push @MESSAGES, @_; - }; -} - - -# a missing file in a defined static dir will return 404 and text/html -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'); - +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/lib"; + +use Test::More tests => 5; +use Catalyst::Test 'TestApp'; + +# test defined static dirs +TestApp->config->{'Plugin::Static::Simple'}->{dirs} = [ + 'always-static', +]; + +TestApp->config->{'Plugin::Static::Simple'}->{debug} = 1; + +use Catalyst::Log; + +local *Catalyst::Log::_send_to_log; +local our @MESSAGES; +{ + no warnings 'redefine'; + *Catalyst::Log::_send_to_log = sub { + my $self = shift; + push @MESSAGES, @_; + }; +} + + +# a missing file in a defined static dir will return 404 and text/html +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'); +