ported tests to make use of run_test_request
[catagits/Web-Simple.git] / t / env.t
CommitLineData
298a02df 1use strict;
2use warnings FATAL => 'all';
3
30e2c525 4use Test::More 'no_plan';
5use Plack::Test;
298a02df 6
7{
8 use Web::Simple 'EnvTest';
9 package EnvTest;
a61c443e 10 sub dispatch_request {
298a02df 11 sub (GET) {
a61c443e 12 my $env = $_[PSGI_ENV];
298a02df 13 [ 200,
14 [ "Content-type" => "text/plain" ],
15 [ 'foo' ]
16 ]
17 },
18 }
19}
20
298a02df 21my $app = EnvTest->new;
22
1bba6f88 23ok $app->run_test_request(GET => 'http://localhost/')->is_success;