cleanups; call to config() was unneeded
[catagits/Catalyst-Plugin-Session.git] / t / 06_finalize.t
CommitLineData
60534014 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7
8{
4ad471ea 9 package TestPlugin;
60534014 10
11 my $finalized = 0;
12 sub finalize_session { $finalized = 1 }
13
14 sub finalize { die "already finalized_session()" if $finalized }
15
4ad471ea 16 # Structure inheritance so TestPlugin->finalize() is called *after*
60534014 17 # Catalyst::Plugin::Session->finalize()
18 package TestApp;
19
4ad471ea 20 use Catalyst qw/
21 Session Session::Store::Dummy Session::State::Cookie +TestPlugin
22 /;
60534014 23 __PACKAGE__->setup;
24}
25
4ad471ea 26BEGIN { use_ok('Catalyst::Plugin::Session') }
60534014 27
28my $c = TestApp->new;
29eval { $c->finalize };
30ok(!$@, "finalize_session() called after all other finalize() methods");