t/dsl/app.t
raw| 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More tests => 2; |
| 4 | use Plack::Test; |
| 5 | use HTTP::Request::Common; |
| 6 | |
| 7 | { |
| 8 | package App; |
| 9 | use Dancer2; |
| 10 | get '/' => sub { |
| 11 | my $app = app; |
| 12 | ::isa_ok( $app, 'Dancer2::Core::App' ); |
| 13 | ::is( $app->name, 'App', 'Correct app name' ); |
| 14 | }; |
| 15 | } |
| 16 | |
| 17 | Plack::Test->create( App->to_app )->request( GET '/' ); |
| 18 |