Do not destroy callback interface (clkao)
[catagits/Web-Session.git] / t / 011_streaming.t
CommitLineData
b2504d01 1use strict;
2use Test::More;
3use Test::Requires qw(Plack::Server::AnyEvent);
4use Plack::Test;
5use Plack::Middleware::Session;
6use HTTP::Request::Common;
7
8$Plack::Test::Impl = 'Server';
9$ENV{PLACK_SERVER} = 'AnyEvent';
10
11my $app = sub {
12 return sub {
13 my $respond = shift;
14 my $w = $respond->([ 200, [ 'Content-Type' => 'text/html' ] ]);
15 $w->write("Hello");
16 $w->close;
17 };
18};
19
20$app = Plack::Middleware::Session->wrap($app);
21
22test_psgi $app, sub {
23 my $cb = shift;
24
25 my $res = $cb->(GET "/");
26 is $res->content, "Hello";
27 like $res->header('Set-Cookie'), qr/plack_session/;
28};
29
30done_testing;