From: Zbigniew Łukasiak Date: Wed, 18 Nov 2009 08:27:11 +0000 (+0000) Subject: finalize_errors is in Context now (t/aggregate/live_component_controller_action_go... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c034d9bff89fd9191dd3679eab3d4656397eef3a;hp=2ecb3b2ba79cd50746abcdf1620041c5e0851c0f;p=catagits%2FCatalyst-Runtime.git finalize_errors is in Context now (t/aggregate/live_component_controller_action_go.t line 114 for exampel) --- diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm index 50238af..0e5f69b 100644 --- a/t/lib/TestApp.pm +++ b/t/lib/TestApp.pm @@ -24,17 +24,6 @@ TestApp->config( name => 'TestApp', root => '/some/dir' ); TestApp->context_class( 'TestApp::Context' ); TestApp->setup; -# Replace the very large HTML error page with -# useful info if something crashes during a test -sub finalize_error { - my $c = shift; - - $c->next::method(@_); - - $c->res->status(500); - $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) ); -} - { no warnings 'redefine'; sub Catalyst::Log::error { } diff --git a/t/lib/TestApp/Context.pm b/t/lib/TestApp/Context.pm index 38e4bb8..f621996 100644 --- a/t/lib/TestApp/Context.pm +++ b/t/lib/TestApp/Context.pm @@ -54,5 +54,16 @@ sub execute { return $c->SUPER::execute(@_); } +# Replace the very large HTML error page with +# useful info if something crashes during a test +sub finalize_error { + my $c = shift; + + $c->next::method(@_); + + $c->res->status(500); + $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) ); +} + 1; diff --git a/t/lib/TestAppOneView.pm b/t/lib/TestAppOneView.pm index 59354b3..df05665 100644 --- a/t/lib/TestAppOneView.pm +++ b/t/lib/TestAppOneView.pm @@ -2,6 +2,9 @@ package TestAppOneView; use strict; use warnings; use Catalyst; +use TestAppOneView::Context; + +TestAppOneView->context_class( 'TestAppOneView::Context' ); __PACKAGE__->setup; diff --git a/t/lib/TestAppOneView/Context.pm b/t/lib/TestAppOneView/Context.pm new file mode 100644 index 0000000..8d439b4 --- /dev/null +++ b/t/lib/TestAppOneView/Context.pm @@ -0,0 +1,17 @@ +package TestAppOneView::Context; +use Moose; +extends 'Catalyst::Context'; + +# Replace the very large HTML error page with +# useful info if something crashes during a test +sub finalize_error { + my $c = shift; + + $c->next::method(@_); + + $c->res->status(500); + $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) ); +} + +1; +