Reworked Session to make the expiration a store's responsibility and
[catagits/Web-Session.git] / t / 012_streaming.t
CommitLineData
b2504d01 1use strict;
2use Test::More;
b2504d01 3use Plack::Test;
4use Plack::Middleware::Session;
5use HTTP::Request::Common;
6
7$Plack::Test::Impl = 'Server';
b2504d01 8
9my $app = sub {
10 return sub {
11 my $respond = shift;
12 my $w = $respond->([ 200, [ 'Content-Type' => 'text/html' ] ]);
13 $w->write("Hello");
14 $w->close;
15 };
16};
17
18$app = Plack::Middleware::Session->wrap($app);
19
20test_psgi $app, sub {
21 my $cb = shift;
22
23 my $res = $cb->(GET "/");
24 is $res->content, "Hello";
25 like $res->header('Set-Cookie'), qr/plack_session/;
26};
27
28done_testing;