Merge master into psgi branch
[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;
57ecbde4 7use Test::Exception;
da054c21 8use Plack::Test;
9use TestApp;
10use HTTP::Request::Common;
11
12my $warning;
13local $SIG{__WARN__} = sub { $warning = $_[0] };
14
15TestApp->setup_engine('PSGI');
16my $app = sub { TestApp->run(@_) };
17
18like $warning, qr/You are running Catalyst\:\:Engine\:\:PSGI/,
19 'got deprecation alert warning';
20
21test_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
37done_testing;
38