X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F006_basic_w_null_store.t;fp=t%2F006_basic_w_null_store.t;h=0000000000000000000000000000000000000000;hb=852657925d5400d65df324678b7a0ce7558ced95;hp=794bfc5e3c9e0c097a13368b3ad834389bd089b7;hpb=98b27b3116e950ce0fc00ac2b7a7795b7ead6a11;p=catagits%2FWeb-Session.git diff --git a/t/006_basic_w_null_store.t b/t/006_basic_w_null_store.t deleted file mode 100755 index 794bfc5..0000000 --- a/t/006_basic_w_null_store.t +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Test::More; -use Test::Exception; - -use Plack::Request; -use Plack::Session; -use Plack::Session::State; -use Plack::Session::Store::Null; -use Plack::Middleware::Session; - -my $storage = Plack::Session::Store::Null->new; -my $state = Plack::Session::State->new; -my $m = Plack::Middleware::Session->new(store => $storage, state => $state); -my $request_creator = sub { - open my $in, '<', \do { my $d }; - my $env = { - 'psgi.version' => [ 1, 0 ], - 'psgi.input' => $in, - 'psgi.errors' => *STDERR, - 'psgi.url_scheme' => 'http', - SERVER_PORT => 80, - REQUEST_METHOD => 'GET', - }; - my $r = Plack::Request->new( $env ); - $r->parameters( @_ ); - $r; -}; - -{ - my $r = $request_creator->(); - - my $s = Plack::Session->fetch_or_create($r, $m); - - ok($s->id, '... got a session id'); - - ok(!$s->get('foo'), '... no value stored in foo for session'); - - lives_ok { - $s->set( foo => 'bar' ); - } '... set the value successfully in session'; - - is($s->get('foo'), 'bar', 'No store, but session works in the session lifetime'); - - lives_ok { - $s->remove('foo'); - } '... removed the value successfully in session'; - - lives_ok { - $s->expire; - } '... expire session successfully'; - - my $resp = $r->new_response; - - lives_ok { - $s->finalize( $m, $resp ); - } '... finalized session successfully'; -} - - -done_testing;