Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (24 sloc) 0.608 kb
use strict;
use Plack::Test;
use HTTP::Request;
use Test::More;
$Plack::Test::Impl = "Server";
$ENV{PLACK_SERVER} = 'Starman';
my $app = sub {
my $env = shift;
return sub {
my $response = shift;
my $writer = $response->([ 200, [ 'Content-Type', 'text/plain' ]]);
$writer->write("Content");
$writer->write("");
$writer->write("Again");
$writer->close;
}
};
test_psgi $app, sub {
my $cb = shift;
my $req = HTTP::Request->new(GET => "http://localhost/");
my $res = $cb->($req);
is $res->content, "ContentAgain";
};
done_testing;
Jump to Line
Something went wrong with that request. Please try again.