X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FAction%2FDetach.pm;h=0709f48b14b51e3a6c7b48839d87bdcc1d85752a;hb=bf7c9c87ac809f8370ee21db7effef130ea6e058;hp=28b0f8f6dd23dd74bb23c3e719abb9522d45913e;hpb=66741f94ac93b7ba0989db3556d0e3fe36c1be87;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Action/Detach.pm b/t/lib/TestApp/Controller/Action/Detach.pm index 28b0f8f..0709f48 100644 --- a/t/lib/TestApp/Controller/Action/Detach.pm +++ b/t/lib/TestApp/Controller/Action/Detach.pm @@ -1,45 +1,45 @@ -package TestApp::Controller::Action::Detach; - -use strict; -use base 'TestApp::Controller::Action'; - -sub one : Local { - my ( $self, $c ) = @_; - $c->detach('two'); - $c->forward('error'); -} - -sub two : Private { - my ( $self, $c ) = @_; - $c->forward('TestApp::View::Dump::Request'); -} - -sub error : Local { - my ( $self, $c ) = @_; - $c->res->output('error'); -} - -sub path : Local { - my ( $self, $c ) = @_; - $c->detach('/action/detach/two'); - $c->forward('error'); -} - -sub with_args : Local { - my ( $self, $c, $orig ) = @_; - $c->detach( 'args', [qq/new/] ); -} - -sub with_method_and_args : Local { - my ( $self, $c, $orig ) = @_; - $c->detach( qw/TestApp::Controller::Action::Detach args/, [qq/new/] ); -} - -sub args : Local { - my ( $self, $c, $val ) = @_; - die "Expected argument 'new', got '$val'" unless $val eq 'new'; - die "passed argument does not match args" unless $val eq $c->req->args->[0]; - $c->res->body( $c->req->args->[0] ); -} - -1; +package TestApp::Controller::Action::Detach; + +use strict; +use base 'TestApp::Controller::Action'; + +sub one : Local { + my ( $self, $c ) = @_; + $c->detach('two'); + $c->forward('error'); +} + +sub two : Private { + my ( $self, $c ) = @_; + $c->forward('TestApp::View::Dump::Request'); +} + +sub error : Local { + my ( $self, $c ) = @_; + $c->res->output('error'); +} + +sub path : Local { + my ( $self, $c ) = @_; + $c->detach('/action/detach/two'); + $c->forward('error'); +} + +sub with_args : Local { + my ( $self, $c, $orig ) = @_; + $c->detach( 'args', [qq/new/] ); +} + +sub with_method_and_args : Local { + my ( $self, $c, $orig ) = @_; + $c->detach( qw/TestApp::Controller::Action::Detach args/, [qq/new/] ); +} + +sub args : Local { + my ( $self, $c, $val ) = @_; + die "Expected argument 'new', got '$val'" unless $val eq 'new'; + die "passed argument does not match args" unless $val eq $c->req->args->[0]; + $c->res->body( $c->req->args->[0] ); +} + +1;