CGI-Emulate-PSGI

 view release on metacpan or  search on metacpan

t/05_lint.t  view on Meta::CPAN

use strict;
use Test::More;
use Test::Requires qw( Plack::Test HTTP::Request Plack::Middleware::Lint );
use Test::Requires {
    'Plack' => 0.9981,
};
use CGI::Emulate::PSGI;

my $output = <<CGI;
Status: 302
Content-Type: text/html
X-Foo: bar
Location: http://localhost/

t/05_lint.t  view on Meta::CPAN

  bar baz

This is the body!
CGI

my $app = CGI::Emulate::PSGI->handler(sub { print $output });
$app = Plack::Middleware::Lint->wrap($app);

Plack::Test::test_psgi($app, sub {
    my $cb = shift;
    my $res = $cb->(HTTP::Request->new(GET => "/"));
    is $res->code, 302;
});

done_testing;



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