File: 12check_error_scope.t

package info (click to toggle)
libcatalyst-plugin-static-simple-perl 0.36-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 384 kB
  • sloc: perl: 2,629; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!perl

use strict;
use warnings;
no strict 'refs';
no warnings 'redefine';

use FindBin;
use lib "$FindBin::Bin/lib";

use Test::More tests => 3;
BEGIN {
    use Catalyst::Plugin::Static::Simple;
    Catalyst::Plugin::Static::Simple->meta->add_before_method_modifier(
        'prepare_action',
        sub {
            my ($c) = @_;
            eval { die("FOO"); };

            ok( $@, '$@ has a value.' );
        }
    );
}
use Catalyst::Test 'TestApp';

TestApp->config->{'Plugin::Static::Simple'}->{dirs} = [qr{stuff/}];

ok( my $res = request("http://localhost/"), 'request ok' );
ok( $res->code == 200, q{Previous error doesn't crash static::simple} );