new test to make sure people using legacy psgi engine who do not upgrade their psgi...
[catagits/Catalyst-Runtime.git] / t / psgi_file_testapp_engine_plackup_compat.t
CommitLineData
da054c21 1use strict;
2use warnings;
3use FindBin qw/$Bin/;
4use lib "$Bin/lib";
5
6use Test::More;
7use Plack::Test;
8use TestApp;
9use HTTP::Request::Common;
10
11my $warning;
12local $SIG{__WARN__} = sub { $warning = $_[0] };
13
14TestApp->setup_engine('PSGI');
15my $app = sub { TestApp->run(@_) };
16
17like $warning, qr/You are running Catalyst\:\:Engine\:\:PSGI/,
18 'got deprecation alert warning';
19
20test_psgi $app, sub {
21 my $cb = shift;
22 eval {
23 my $TIMEOUT_IN_SECONDS = 5;
24 local $SIG{ALRM} = sub { die "alarm\n" };
25 alarm($TIMEOUT_IN_SECONDS);
26
27 my $res = $cb->(GET "/");
28 is $res->content, "root index", 'got expected content';
29 like $warning, qr/env as a writer/, 'got deprecation alert warning';
30
31 alarm(0);
32 1
33 } || fail "$@ problem";
34};
35
36done_testing;
37