| 1 |
#!perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
|
| 6 |
use Test::More tests => 2; |
| 7 |
use Plack::Test; |
| 8 |
use HTTP::Request::Common; |
| 9 |
use Path::Tiny qw< path >; |
| 10 |
|
| 11 |
{ |
| 12 |
package App; |
| 13 |
use Dancer2; |
| 14 |
|
| 15 |
get '/' => sub { app->caller }; |
| 16 |
|
| 17 |
} |
| 18 |
|
| 19 |
my $app = App->to_app; |
| 20 |
test_psgi $app, sub { |
| 21 |
my $cb = shift; |
| 22 |
my $res = $cb->( GET '/' ); |
| 23 |
|
| 24 |
is( $res->code, 200, '[GET /] Successful' ); |
| 25 |
is( |
| 26 |
path( $res->content )->stringify, |
| 27 |
path(qw<t caller.t>)->stringify, |
| 28 |
'Correct App name from caller', |
| 29 |
); |
| 30 |
}; |