Debian Codegraph @

t/dsl/to_app.t

raw
1 use strict;
2 use warnings;
3 use Plack::Test;
4 use HTTP::Request::Common;
5 use Test::More tests => 2;
6
7 {
8 package App1;
9 use Dancer2;
10 get '/' => sub {'App1'};
11
12 my $app = to_app;
13 ::test_psgi $app, sub {
14 my $cb = shift;
15 ::is( $cb->( ::GET '/' )->content, 'App1', 'Got first App' );
16 };
17 }
18
19 {
20 package App2;
21 use Dancer2;
22 get '/' => sub {'App2'};
23
24 my $app = to_app;
25 ::test_psgi $app, sub {
26 my $cb = shift;
27 ::is( $cb->( ::GET '/' )->content, 'App2', 'Got second App' );
28 };
29 }
30
31