fixed problems with mod_perl2
[catagits/Catalyst-Runtime.git] / t / 14beginend.t
1 package TestApp;
2
3 use Catalyst qw[-Engine=Test];
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
21 package TestApp::C::Foo::Bar;
22
23 TestApp->action(
24
25     '!begin' => sub {
26         my ( $self, $c ) = @_;
27         $c->res->output('yada');
28     },
29
30     '!default' => sub { },
31
32     '!end' => sub {
33         my ( $self, $c ) = @_;
34         $c->res->output('yada');
35         $c->res->output( $c->res->output . 'yada' );
36     },
37
38 );
39
40 package main;
41
42 use Test::More tests => 2;
43 use Catalyst::Test 'TestApp';
44
45 ok( get('/foo')         =~ /foobar/ );
46 ok( get('/foo/bar/foo') =~ /yadayada/ );