Merge pull request #7 from tokuhirom/master
[catagits/Web-Session.git] / t / 001_basic.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use Plack::Request;
9 use Plack::Session;
10 use Plack::Session::State;
11 use Plack::Session::Store;
12
13 use t::lib::TestSession;
14
15 t::lib::TestSession::run_all_tests(
16     store  => Plack::Session::Store->new,
17     state  => Plack::Session::State->new,
18     env_cb => sub {
19         open my $in, '<', \do { my $d };
20         my $env = {
21             'psgi.version'    => [ 1, 0 ],
22             'psgi.input'      => $in,
23             'psgi.errors'     => *STDERR,
24             'psgi.url_scheme' => 'http',
25             SERVER_PORT       => 80,
26             REQUEST_METHOD    => 'GET',
27             QUERY_STRING      => join "&" => map { $_ . "=" . $_[0]->{ $_ } } keys %{$_[0] || +{}},
28         };
29     },
30 );
31
32 done_testing;