rename psgix.session to plack.session
[catagits/Web-Session.git] / t / 003_basic_w_file_store.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use File::Spec;
6
7 use Test::More;
8
9 use Plack::Request;
10 use Plack::Session;
11 use Plack::Session::State::Cookie;
12 use Plack::Session::Store::File;
13
14 use t::lib::TestSession;
15
16 my $TMP = File::Spec->catdir('t', 'tmp');
17
18 t::lib::TestSession::run_all_tests(
19     store           => Plack::Session::Store::File->new( dir => $TMP ),
20     state           => Plack::Session::State->new,
21     request_creator => sub {
22         open my $in, '<', \do { my $d };
23         my $env = {
24             'psgi.version'    => [ 1, 0 ],
25             'psgi.input'      => $in,
26             'psgi.errors'     => *STDERR,
27             'psgi.url_scheme' => 'http',
28             SERVER_PORT       => 80,
29             REQUEST_METHOD    => 'GET',
30         };
31         my $r = Plack::Request->new( $env );
32         $r->parameters( @_ );
33         $r;
34     },
35 );
36
37 unlink $_ foreach glob( File::Spec->catdir($TMP, '*') );
38
39 done_testing;