CGI-Application-Emulate-PSGI

 view release on metacpan or  search on metacpan

t/00base.t  view on Meta::CPAN


use_ok 'CGI::Application::Emulate::PSGI';

test_psgi
    app    => CGI::Application::Emulate::PSGI->handler(sub {
        my $ca = MyCGIApp->new;
        $ca->run;
    }),
    client => sub {
        my $cb = shift;
        my $req = HTTP::Request->new(GET => 'http://localhost/');
        my $res = $cb->($req);
        is $res->code, 200, 'status code is 200';
        is $res->content_type, 'application/x-hello-world', 'content-type';
        is $res->content, 'hello world', 'body';
    };

done_testing;

package MyCGIApp;



( run in 0.532 second using v1.01-cache-2.11-cpan-de7293f3b23 )