fixed a few spaces
[catagits/Web-Simple.git] / t / env.t
1 use strict;
2 use warnings FATAL => 'all';
3
4 use Test::More 'no_plan';
5 use Plack::Test;
6
7 {
8   use Web::Simple 'EnvTest';
9   package EnvTest;
10   sub dispatch_request  {
11     sub (GET) {
12       my $env = $_[PSGI_ENV];
13       [ 200,
14         [ "Content-type" => "text/plain" ],
15         [ 'foo' ]
16       ]
17     },
18   }
19 }
20
21 use HTTP::Request::Common qw(GET POST);
22
23 my $app = EnvTest->new;
24
25 sub run_request {
26   my $request = shift;
27   return test_psgi $app->to_psgi_app, sub { shift->($request) };
28 }
29
30 ok run_request(GET 'http://localhost/')->is_success;