actually document the new request body_data method
[catagits/Catalyst-Runtime.git] / t / psgi_file_testapp_engine_plackup_compat.t
1 use strict;
2 use warnings;
3 use FindBin qw/$Bin/;
4 use lib "$Bin/lib";
5
6 use Test::More;
7 use Test::Exception;
8 use Plack::Test;
9 use TestApp;
10 use HTTP::Request::Common;
11
12 plan skip_all => "Catalyst::Engine::PSGI required for this test"
13     unless eval { local $SIG{__WARN__} = sub{}; require Catalyst::Engine::PSGI; 1; };
14
15 my $warning;
16 local $SIG{__WARN__} = sub { $warning = $_[0] };
17
18 TestApp->setup_engine('PSGI');
19 my $app = sub { TestApp->run(@_) };
20
21 like $warning, qr/You are running Catalyst\:\:Engine\:\:PSGI/,
22   'got deprecation alert warning';
23
24 test_psgi $app, sub {
25     my $cb = shift;
26     lives_ok {
27         my $TIMEOUT_IN_SECONDS = 5;
28         local $SIG{ALRM} = sub { die "alarm\n" };
29         alarm($TIMEOUT_IN_SECONDS);
30
31         my $res = $cb->(GET "/");
32         is $res->content, "root index", 'got expected content';
33         like $warning, qr/env as a writer/, 'got deprecation alert warning';
34
35         alarm(0);
36         1
37     } q{app didn't die or timeout};
38 };
39
40 done_testing;
41