Commit | Line | Data |
b2504d01 |
1 | use strict; |
2 | use Test::More; |
b2504d01 |
3 | use Plack::Test; |
4 | use Plack::Middleware::Session; |
5 | use HTTP::Request::Common; |
6 | |
7 | $Plack::Test::Impl = 'Server'; |
b2504d01 |
8 | |
9 | my $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 | |
20 | test_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 | |
28 | done_testing; |