stop using Moo as a test package
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_action_chained.t
index 221169a..f0cbc6a 100644 (file)
@@ -1,5 +1,3 @@
-#!perl
-
 use strict;
 use warnings;
 
@@ -773,7 +771,26 @@ sub run_tests {
     }
 
     #
+    # Test throwing an error in the middle of a chain.
     #
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Chained->begin
+          TestApp::Controller::Action::Chained->chain_error_a
+          TestApp::Controller::Action::Chained->end
+        ];
+
+        my $expected = join( ", ", @expected );
+
+        ok( my $response = request('http://localhost/chained/chain_error/1/end/2'),
+            "Break a chain in the middle" );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, 'FATAL ERROR: break in the middle of a chain', 'Content OK' );
+    }
+
+    #
+    # Test dieing in the middle of a chain.
     #
     {
         my @expected = qw[
@@ -788,7 +805,7 @@ sub run_tests {
             "Break a chain in the middle" );
         is( $response->header('X-Catalyst-Executed'),
             $expected, 'Executed actions' );
-        is( $response->content, 'FATAL ERROR: break in the middle of a chain', 'Content OK' );
+        is( $response->content, 'FATAL ERROR: Caught exception in TestApp::Controller::Action::Chained->chain_die_a "die in the middle of a chain"', 'Content OK' );
     }
 
     #