fix Test::More version used, for done_testing
[catagits/Web-Simple.git] / t / sub-dispatch-env.t
CommitLineData
1f4dd6f9 1use strictures 1;
a30328b3 2use Test::More 0.88;
1f4dd6f9 3
4{
5 package TestApp;
6
7 use Web::Simple;
8
9 sub dispatch_request {
10 sub (/foo/...) {
11 sub (GET) { [ 200, [], [ $_[PSGI_ENV]->{PATH_INFO} ] ] }
12 },
13 sub (POST) { [ 200, [], [ $_[PSGI_ENV]->{PATH_INFO} ] ] }
14 }
15}
16
17my $app = TestApp->new->to_psgi_app;
18
19my $call = sub { $app->({
20 SCRIPT_NAME => '/base', PATH_INFO => '/foo/bar', REQUEST_METHOD => shift
21})->[2]->[0] };
22
23is($call->('GET'), '/bar', 'recursive strip ok');
24is($call->('POST'), '/foo/bar', 'later dispatchers unaffected');
25
26done_testing;