[Catalyst-commits] r11864 - in
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib:
. TestApp
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Tue Nov 17 14:45:16 GMT 2009
Author: zby
Date: 2009-11-17 14:45:13 +0000 (Tue, 17 Nov 2009)
New Revision: 11864
Modified:
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp.pm
Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp/Context.pm
Log:
execute is now in Context - fixing test libs (for example test t/aggregate/live_component_controller_action_index.t)
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-17 14:30:23 UTC (rev 11863)
+++ Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp/Context.pm 2009-11-17 14:45:13 UTC (rev 11864)
@@ -21,5 +21,36 @@
return scalar @{ $ctx->leaks };
}
+sub execute {
+ my $c = shift;
+ my $class = ref( $c->component( $_[0] ) ) || $_[0];
+ my $action = $_[1]->reverse;
+
+ my $method;
+
+ if ( $action =~ /->(\w+)$/ ) {
+ $method = $1;
+ }
+ elsif ( $action =~ /\/(\w+)$/ ) {
+ $method = $1;
+ }
+ elsif ( $action =~ /^(\w+)$/ ) {
+ $method = $action;
+ }
+
+ if ( $class && $method && $method !~ /^_/ ) {
+ my $executed = sprintf( "%s->%s", $class, $method );
+ my @executed = $c->response->headers->header('X-Catalyst-Executed');
+ push @executed, $executed;
+ $c->response->headers->header(
+ 'X-Catalyst-Executed' => join ', ',
+ @executed
+ );
+ }
+ no warnings 'recursion';
+ return $c->SUPER::execute(@_);
+}
+
+
1;
Modified: Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp.pm 2009-11-17 14:30:23 UTC (rev 11863)
+++ Catalyst-Runtime/5.80/branches/basic-app-ctx-separation-cleaned/t/lib/TestApp.pm 2009-11-17 14:45:13 UTC (rev 11864)
@@ -24,36 +24,6 @@
TestApp->context_class( 'TestApp::Context' );
TestApp->setup;
-sub execute {
- my $c = shift;
- my $class = ref( $c->component( $_[0] ) ) || $_[0];
- my $action = $_[1]->reverse;
-
- my $method;
-
- if ( $action =~ /->(\w+)$/ ) {
- $method = $1;
- }
- elsif ( $action =~ /\/(\w+)$/ ) {
- $method = $1;
- }
- elsif ( $action =~ /^(\w+)$/ ) {
- $method = $action;
- }
-
- if ( $class && $method && $method !~ /^_/ ) {
- my $executed = sprintf( "%s->%s", $class, $method );
- my @executed = $c->response->headers->header('X-Catalyst-Executed');
- push @executed, $executed;
- $c->response->headers->header(
- 'X-Catalyst-Executed' => join ', ',
- @executed
- );
- }
- no warnings 'recursion';
- return $c->SUPER::execute(@_);
-}
-
# Replace the very large HTML error page with
# useful info if something crashes during a test
sub finalize_error {
More information about the Catalyst-commits
mailing list