make t/04 to t/10 pass.
[catagits/Catalyst-Runtime.git] / t / 14beginend.t
CommitLineData
fc7ec1d9 1package TestApp;
2
e05c5e3c 3use Catalyst qw[-Engine=Test];
fc7ec1d9 4
5__PACKAGE__->action(
6
7 '!begin' => sub {
8 my ( $self, $c ) = @_;
9 $c->res->output('foo');
10 },
11
12 '!default' => sub { },
13
14 '!end' => sub {
15 my ( $self, $c ) = @_;
16 $c->res->output( $c->res->output . 'bar' );
17 },
18
19);
20
21package TestApp::C::Foo::Bar;
22
23TestApp->action(
24
847c44c5 25 '!begin' => sub {
fc7ec1d9 26 my ( $self, $c ) = @_;
27 $c->res->output('yada');
28 },
29
847c44c5 30 '!default' => sub { },
fc7ec1d9 31
847c44c5 32 '!end' => sub {
fc7ec1d9 33 my ( $self, $c ) = @_;
34 $c->res->output('yada');
35 $c->res->output( $c->res->output . 'yada' );
36 },
37
38);
39
40package main;
41
42use Test::More tests => 2;
43use Catalyst::Test 'TestApp';
44
45ok( get('/foo') =~ /foobar/ );
847c44c5 46ok( get('/foo/bar/foo') =~ /yadayada/ );