X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FTestAppClassExceptionSimpleTest.pm;h=cc0ba44b7798e4a756954d1558a6b9edb75f1aaa;hp=aec9cbc26e86c693b755630f81ec9e6284121d37;hb=82010ea176741c7a4f2baf3f6f27377b1d9f6b15;hpb=64628b1805489058fd8dc1de38f95929b8e3c4ae diff --git a/t/lib/TestAppClassExceptionSimpleTest.pm b/t/lib/TestAppClassExceptionSimpleTest.pm index aec9cbc..cc0ba44 100644 --- a/t/lib/TestAppClassExceptionSimpleTest.pm +++ b/t/lib/TestAppClassExceptionSimpleTest.pm @@ -1,53 +1,20 @@ -package TestAppClassExceptionSimpleTest::Exceptions; - -use strict; -use warnings; - -BEGIN { - $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; - - my %classes = ( - 'TestAppClassExceptionSimpleTest::Exception' => { - description => 'Generic exception', - alias => 'throw' - }, - ); - - my @exports = grep { defined } map { $classes{ $_ }->{ alias } } keys %classes; - - require Exception::Class; - require Sub::Exporter; - - Exception::Class->import(%classes); - Sub::Exporter->import( -setup => { exports => \@exports } ); -} - package TestAppClassExceptionSimpleTest::Exception; - use strict; use warnings; -no warnings 'redefine'; -use HTTP::Headers (); -use HTTP::Status (); -use Scalar::Util qw( blessed ); - -sub status { - return $_[0]->{status} ||= 500; -} +sub throw {} ######### package TestAppClassExceptionSimpleTest; - use strict; use warnings; -use Scalar::Util (); -use Catalyst::Runtime '5.80'; -use Catalyst qw/ -Debug /; +use Catalyst::Utils; #< some of the scripts use Catalyst::Utils before MyApp.pm + +BEGIN { $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; } -our $VERSION = '0.02'; +use Catalyst; __PACKAGE__->setup;