Test actually dies hard due to that division, fix to just die and so get filled
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 12check_error_scope.t
CommitLineData
fb25065e 1#!perl
2
3use strict;
4use warnings;
5no strict 'refs';
6no warnings 'redefine';
7
8use FindBin;
9use lib "$FindBin::Bin/lib";
10
11use Test::More tests => 3;
12use Catalyst::Test 'TestApp';
13
14TestApp->config->{ static }->{ dirs } = [ qr{stuff/} ];
15my $orig_sub = *Catalyst::Plugin::Static::Simple::prepare_action{CODE};
16
17*Catalyst::Plugin::Static::Simple::prepare_action = sub {
18 my ($c) = @_;
19
09a62aad 20 eval { die("FOO"); };
fb25065e 21
22 ok ($@, '$@ has a value.');
23 return $orig_sub->( $c );
24};
25
26ok( my $res = request("http://localhost/"), 'request ok' );
27ok( $res->code == 200, q{Previous error doesn't crash static::simple} );