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=0c452cebfbba146edc0d9f8bc23a88fef527e4a3;hb=82010ea176741c7a4f2baf3f6f27377b1d9f6b15;hpb=08f9c84867673a57d45bacbda7a301734a720fe7 diff --git a/t/lib/TestAppClassExceptionSimpleTest.pm b/t/lib/TestAppClassExceptionSimpleTest.pm index 0c452ce..cc0ba44 100644 --- a/t/lib/TestAppClassExceptionSimpleTest.pm +++ b/t/lib/TestAppClassExceptionSimpleTest.pm @@ -1,85 +1,21 @@ -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; - -## thank to Brian -## http://bricas.vox.com/library/post/catalyst-exceptionclass.html - 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 -our $VERSION = '0.02'; +BEGIN { $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; } -# Start the application -__PACKAGE__->setup; +use Catalyst; -=head1 NAME - -TestAppClassExceptionSimpleTest - Catalyst based application - -=head1 SYNOPSIS - - script/TestAppClassExceptionSipleTest_server.pl - -=head1 DESCRIPTION - -[enter your description here] - -=head1 SEE ALSO - -L, L - -=head1 AUTHOR - -Ferruccio Zamuner - -=head1 LICENSE - -This library is free software, you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut +__PACKAGE__->setup; 1;