50238af93e11858e3e49224a0fafd163c4ec3167
[catagits/Catalyst-Runtime.git] / t / lib / TestApp.pm
1 package TestApp;
2
3 use strict;
4 use Catalyst qw/
5     Test::MangleDollarUnderScore
6     Test::Errors 
7     Test::Headers 
8     Test::Plugin
9     Test::Inline
10     +TestApp::Plugin::FullyQualified
11     +TestApp::Plugin::AddDispatchTypes
12     +TestApp::Role
13 /;
14 use Catalyst::Utils;
15 use TestApp::Context;
16
17 use Moose;
18 use namespace::autoclean;
19
20 our $VERSION = '0.01';
21
22 TestApp->config( name => 'TestApp', root => '/some/dir' );
23
24 TestApp->context_class( 'TestApp::Context' );
25 TestApp->setup;
26
27 # Replace the very large HTML error page with
28 # useful info if something crashes during a test
29 sub finalize_error {
30     my $c = shift;
31     
32     $c->next::method(@_);
33     
34     $c->res->status(500);
35     $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
36 }
37
38 {
39     no warnings 'redefine';
40     sub Catalyst::Log::error { }
41 }
42
43 # Make sure we can load Inline plugins. 
44
45 package Catalyst::Plugin::Test::Inline;
46
47 use strict;
48
49 use base qw/Class::Data::Inheritable/;
50
51 1;