Commit | Line | Data |
da054c21 |
1 | use strict; |
2 | use warnings; |
3 | use FindBin qw/$Bin/; |
4 | use lib "$Bin/lib"; |
5 | |
6 | use Test::More; |
57ecbde4 |
7 | use Test::Exception; |
da054c21 |
8 | use Plack::Test; |
9 | use TestApp; |
10 | use HTTP::Request::Common; |
11 | |
12 | my $warning; |
13 | local $SIG{__WARN__} = sub { $warning = $_[0] }; |
14 | |
15 | TestApp->setup_engine('PSGI'); |
16 | my $app = sub { TestApp->run(@_) }; |
17 | |
18 | like $warning, qr/You are running Catalyst\:\:Engine\:\:PSGI/, |
19 | 'got deprecation alert warning'; |
20 | |
21 | test_psgi $app, sub { |
22 | my $cb = shift; |
57ecbde4 |
23 | lives_ok { |
da054c21 |
24 | my $TIMEOUT_IN_SECONDS = 5; |
25 | local $SIG{ALRM} = sub { die "alarm\n" }; |
26 | alarm($TIMEOUT_IN_SECONDS); |
27 | |
28 | my $res = $cb->(GET "/"); |
29 | is $res->content, "root index", 'got expected content'; |
30 | like $warning, qr/env as a writer/, 'got deprecation alert warning'; |
31 | |
32 | alarm(0); |
33 | 1 |
57ecbde4 |
34 | } q{app didn't die or timeout}; |
da054c21 |
35 | }; |
36 | |
37 | done_testing; |
38 | |