[Catalyst-commits] r11885 - in
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib:
Catalyst/Plugin/Test Catalyst/TraitFor/Context TestApp
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Wed Nov 18 07:00:23 GMT 2009
Author: zby
Date: 2009-11-18 07:00:22 +0000 (Wed, 18 Nov 2009)
New Revision: 11885
Added:
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/TraitFor/Context/TestPluginServer.pm
Modified:
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/Plugin/Test/Plugin.pm
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp/Context.pm
Log:
prepare_action is in context (t/aggregate/live_engine_request_body.t)
Modified: Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/Plugin/Test/Plugin.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/Plugin/Test/Plugin.pm 2009-11-18 06:58:08 UTC (rev 11884)
+++ Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/Plugin/Test/Plugin.pm 2009-11-18 07:00:22 UTC (rev 11885)
@@ -22,14 +22,5 @@
return $c;
}
-# Note: Catalyst::Plugin::Server forces the body to
-# be parsed, by calling the $c->req->body method in prepare_action.
-# We need to test this, as this was broken by 5.80. See also
-# t/aggregate/live_engine_request_body.t.
-sub prepare_action {
- my $c = shift;
- $c->res->header('X-Have-Request-Body', 1) if $c->req->body;
- $c->next::method(@_);
-}
1;
Added: Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/TraitFor/Context/TestPluginServer.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/TraitFor/Context/TestPluginServer.pm (rev 0)
+++ Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/Catalyst/TraitFor/Context/TestPluginServer.pm 2009-11-18 07:00:22 UTC (rev 11885)
@@ -0,0 +1,15 @@
+package Catalyst::TraitFor::Context::TestPluginServer;
+
+use Moose::Role;
+
+# Note: Catalyst::Plugin::Server forces the body to
+# be parsed, by calling the $c->req->body method in prepare_action.
+# We need to test this, as this was broken by 5.80. See also
+# t/aggregate/live_engine_request_body.t.
+
+after prepare_action => sub {
+ my $c = shift;
+ $c->res->header('X-Have-Request-Body', 1) if $c->req->body;
+};
+
+1;
Modified: Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp/Context.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp/Context.pm 2009-11-18 06:58:08 UTC (rev 11884)
+++ Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp/Context.pm 2009-11-18 07:00:22 UTC (rev 11885)
@@ -1,8 +1,9 @@
package TestApp::Context;
use Moose;
extends 'Catalyst::Context';
-with 'Catalyst::TraitFor::Context::TestHeaders';
-with 'Catalyst::TraitFor::Context::TestErrors';
+with 'Catalyst::TraitFor::Context::TestHeaders',
+ 'Catalyst::TraitFor::Context::TestErrors',
+ 'Catalyst::TraitFor::Context::TestPluginServer';
if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
with 'CatalystX::LeakChecker';
More information about the Catalyst-commits
mailing list