X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestAppDoubleAutoBug.pm;h=cc9e6b8f6950328355f0eae2b45f13b6f0f6287e;hb=65441f616076032cd15ccfcaee7f39f5ee012ee8;hp=524ed8ba3de67203877b0fc129a6890cdd0b7ef7;hpb=8458a66a25f3bd41bc9b6f13a1cd59000a2da411;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestAppDoubleAutoBug.pm b/t/lib/TestAppDoubleAutoBug.pm index 524ed8b..cc9e6b8 100644 --- a/t/lib/TestAppDoubleAutoBug.pm +++ b/t/lib/TestAppDoubleAutoBug.pm @@ -9,41 +9,13 @@ use Catalyst qw/ Test::Plugin /; +use TestApp::Context; + our $VERSION = '0.01'; __PACKAGE__->config( name => 'TestAppDoubleAutoBug', root => '/some/dir' ); - +__PACKAGE__->context_class( 'TestApp::Context' ); __PACKAGE__->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 - ); - } - - return $c->SUPER::execute(@_); -} - 1;