From 808f38b2a64e4e3744f53c9b486d13c858889a16 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 24 Jun 2010 10:52:43 -0700 Subject: [PATCH] Session cleanup for t/Exception/app.t --- t/Exception/app.t | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/t/Exception/app.t b/t/Exception/app.t index b7e222108..d43bbd7c3 100644 --- a/t/Exception/app.t +++ b/t/Exception/app.t @@ -19,7 +19,6 @@ my $regular_app = builder { }; my $generic_dead_app = builder { - enable '+WebGUI::Middleware::Session', config => $wg->config; enable '+WebGUI::Middleware::HTTPExceptions'; # Pretend that WebGUI dies during request handling @@ -27,11 +26,10 @@ my $generic_dead_app = builder { }; my $specific_dead_app = builder { - enable '+WebGUI::Middleware::Session', config => $wg->config; enable '+WebGUI::Middleware::HTTPExceptions'; # Pretend that WebGUI throws a '501 - Not Implemented' HTTP error - sub { HTTP::Exception->throw(501) } + sub { HTTP::Exception->throw(501) }; }; my $fatal_app = builder { @@ -42,6 +40,7 @@ my $fatal_app = builder { sub { my $env = shift; + WebGUI::Test->addToCleanup($env->{'webgui.session'}); $env->{'webgui.session'}->log->fatal('Fatally yours'); } }; @@ -50,7 +49,11 @@ my $not_found_app = builder { enable '+WebGUI::Middleware::Session', config => $wg->config; enable '+WebGUI::Middleware::HTTPExceptions'; - sub { HTTP::Exception->throw(404) } + sub { + my $env = shift; + WebGUI::Test->addToCleanup($env->{'webgui.session'}); + HTTP::Exception->throw(404) + }; }; test_psgi $regular_app, sub {