X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=t%2F34exception_action.t;h=8fd70bac853a417610f62f4038bea90e2e665e84;hp=7fef551f0e9bc5bd6db8722ee72144805c5ffbca;hb=b2f408f3651f1f86865e4f850858fe73ad18a084;hpb=a28009914a3e447af53737d503b1953160d146c9 diff --git a/t/34exception_action.t b/t/34exception_action.t index 7fef551..8fd70ba 100644 --- a/t/34exception_action.t +++ b/t/34exception_action.t @@ -5,7 +5,7 @@ use Test::More; use lib qw(t/lib); use DBICTest; -plan tests => 6; +plan tests => 8; # Set up the "usual" sqlite for DBICTest my $schema = DBICTest->init_schema; @@ -19,6 +19,12 @@ my $ex_regex = qr/Odd number of arguments to search/; # Basic check, normal exception eval { throwex }; +my $e = $@; # like() seems to stringify $@ +like($@, $ex_regex); + +# Re-throw the exception with rethrow() +eval { $e->rethrow }; +isa_ok( $@, 'DBIx::Class::Exception' ); like($@, $ex_regex); # Now lets rethrow via exception_action