finalize_errors is in Context now (t/aggregate/live_component_controller_action_go...
Zbigniew Łukasiak [Wed, 18 Nov 2009 08:27:11 +0000 (08:27 +0000)]
t/lib/TestApp.pm
t/lib/TestApp/Context.pm
t/lib/TestAppOneView.pm
t/lib/TestAppOneView/Context.pm [new file with mode: 0644]

index 50238af..0e5f69b 100644 (file)
@@ -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 { }
index 38e4bb8..f621996 100644 (file)
@@ -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;
 
index 59354b3..df05665 100644 (file)
@@ -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 (file)
index 0000000..8d439b4
--- /dev/null
@@ -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;
+