Debian Codegraph @

t/issues/gh-1226/gh-1226.t

raw
1 use strict;
2 use warnings;
3 use lib 't/issues/gh-1226/lib';
4
5 use Test::More 'tests' => 4 + 9;
6 use Test::Fatal qw<exception>;
7 use Plack::Test ();
8 use Module::Runtime qw<require_module>;
9 use HTTP::Request::Common qw<GET>;
10
11 my $app;
12 is(
13 exception {
14 require_module('App');
15 $app = App->to_app;
16 },
17 undef,
18 'No exception when creating new app',
19 );
20
21 isa_ok( $app, 'CODE' );
22
23 my $test = Plack::Test->create($app);
24 my $response = $test->request( GET '/' );
25 is( $response->code, 200, 'Correct response code' );
26 is( $response->content, 'OK', 'Correct response content' );