X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F34exception_action.t;h=8fd70bac853a417610f62f4038bea90e2e665e84;hb=40b2fcfe2daed009b1bd78d78f851937b333a149;hp=7fef551f0e9bc5bd6db8722ee72144805c5ffbca;hpb=c216324aa4b0f79ba056fbe74adbd735421e378a;p=dbsrgits%2FDBIx-Class.git 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