Change configuration key to 'Plugin::Static::Simple' by default.
[catagits/Catalyst-Plugin-Static-Simple.git] / t / 12check_error_scope.t
1 #!perl
2
3 use strict;
4 use warnings;
5 no strict 'refs';
6 no warnings 'redefine';
7
8 use FindBin;
9 use lib "$FindBin::Bin/lib";
10
11 use Test::More tests => 3;
12 BEGIN {
13     use Catalyst::Plugin::Static::Simple;
14     Catalyst::Plugin::Static::Simple->meta->add_before_method_modifier(
15         'prepare_action',
16         sub {
17             my ($c) = @_;
18             eval { die("FOO"); };
19
20             ok( $@, '$@ has a value.' );
21         }
22     );
23 }
24 use Catalyst::Test 'TestApp';
25
26 TestApp->config->{'Plugin::Static::Simple'}->{dirs} = [qr{stuff/}];
27
28 ok( my $res = request("http://localhost/"), 'request ok' );
29 ok( $res->code == 200, q{Previous error doesn't crash static::simple} );