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