X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F14beginend.t;h=3e194deaff5a3de96e8afc1fecbb356f0ccdf7e2;hb=a8ed7612b5afccad8cfda4fe1dc8947bda89516d;hp=81bd9d9ca969024203616b792db74e279df9176d;hpb=dea8ff68a7552057e3850b2a1ebc4f2190c769af;p=catagits%2FCatalyst-Runtime.git diff --git a/t/14beginend.t b/t/14beginend.t index 81bd9d9..3e194de 100644 --- a/t/14beginend.t +++ b/t/14beginend.t @@ -2,40 +2,37 @@ package TestApp; use Catalyst qw[-Engine=Test]; -__PACKAGE__->action( - '!begin' => sub { - my ( $self, $c ) = @_; - $c->res->output('foo'); - }, +sub begin : Private { + my ( $self, $c ) = @_; + $c->res->output('foo'); +} - '!default' => sub { }, +sub default : Private { } - '!end' => sub { - my ( $self, $c ) = @_; - $c->res->output( $c->res->output . 'bar' ); - }, +sub end : Private { + my ( $self, $c ) = @_; + $c->res->output( $c->res->output . 'bar' ); +} -); -package TestApp::C::Foo::Bar; +__PACKAGE__->setup; -TestApp->action( +package TestApp::C::Foo::Bar; - '!begin' => sub { - my ( $self, $c ) = @_; - $c->res->output('yada'); - }, +use base 'Catalyst::Base'; - '!default' => sub { }, +sub begin : Private { + my ( $self, $c ) = @_; + $c->res->output('yada'); +} - '!end' => sub { - my ( $self, $c ) = @_; - $c->res->output('yada'); - $c->res->output( $c->res->output . 'yada' ); - }, +sub default : Private { } -); +sub end : Private { + my ( $self, $c ) = @_; + $c->res->output( $c->res->output . 'yada' ); +} package main;