package Catalyst::Utils;
use strict;
-use Catalyst::Exception;
use File::Spec;
use HTTP::Request;
use Path::Class;
eval { $tmpdir->mkpath };
if ($@) {
+ # don't load Catalyst::Exception as a BEGIN in Utils,
+ # because Utils often gets loaded before MyApp.pm, and if
+ # Catalyst::Exception is loaded before MyApp.pm, it does
+ # not honor setting
+ # $Catalyst::Exception::CATALYST_EXCEPTION_CLASS in
+ # MyApp.pm
+ require Catalyst::Exception;
Catalyst::Exception->throw(
message => qq/Couldn't create tmpdir '$tmpdir', "$@"/ );
}
use warnings;
use FindBin qw/$Bin/;
use lib "$Bin/lib";
-use Test::More tests => 1;
+use Test::More tests => 2;
use Test::Exception;
lives_ok {
require TestAppClassExceptionSimpleTest;
} 'Can load application';
+
+
+lives_ok {
+ Catalyst::Exception->throw
+} 'throw is properly stubbed out';
+
+
+