X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F34exception_action.t;h=f76a100ffd89e7560e70c2ce4437ee5f81179b6e;hb=6c3e6bf62e7b21a233f9dea22b2228f1c4e2381a;hp=8fd70bac853a417610f62f4038bea90e2e665e84;hpb=b2f408f3651f1f86865e4f850858fe73ad18a084;p=dbsrgits%2FDBIx-Class.git diff --git a/t/34exception_action.t b/t/34exception_action.t index 8fd70ba..f76a100 100644 --- a/t/34exception_action.t +++ b/t/34exception_action.t @@ -1,11 +1,11 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); use DBICTest; -plan tests => 8; +plan tests => 9; # Set up the "usual" sqlite for DBICTest my $schema = DBICTest->init_schema; @@ -68,3 +68,15 @@ like($@, qr/DBICTest::Exception is handling this: $ex_regex/); # While we're at it, lets throw a custom exception through Storage::DBI eval { $schema->storage->throw_exception('floob') }; like($@, qr/DBICTest::Exception is handling this: floob/); + + +# This usage is a bit unusual but it was actually seen in the wild +eval { + + my $dbh = $schema->storage->dbh; + undef $schema; + + $dbh->do ('glaring_syntax_error;'); +}; +like($@, qr/DBI Exception.+do failed/, 'Exception thrown even after $storage is destroyed'); +