X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=t%2Fstorage%2Ferror.t;h=e15aa1dd24470ec3754398f4384876aa36be0794;hp=68bbb5ad06237230affb6f6d0a1f81cce1bfb2dd;hb=0007aedf713cd43ec7c96e95209a1c4117a5a851;hpb=9ba33dac83e74b37b5bde62f0f9da4cf22c0e7e4 diff --git a/t/storage/error.t b/t/storage/error.t index 68bbb5a..e15aa1d 100644 --- a/t/storage/error.t +++ b/t/storage/error.t @@ -11,14 +11,12 @@ use_ok( 'DBICTest::Schema' ); my $schema = DBICTest->init_schema; -my $e_start = quotemeta('DBIx::Class::'); - warnings_are ( sub { throws_ok ( sub { $schema->resultset('CD')->create({ title => 'vacation in antarctica' }) }, - qr/$e_start.+constraint failed.+NULL/s + qr/DBI Exception.+constraint failed.+cd\.artist.+NULL/s ); # as opposed to some other error }, [], 'No warnings besides exception' ); @@ -28,7 +26,7 @@ throws_ok ( sub { $dbh->do ('INSERT INTO nonexistent_table VALUES (1)') }, - qr/$e_start.+DBI Exception.+no such table/, + qr/DBI Exception.+no such table.+nonexistent_table/s, 'DBI exceptions properly handled by dbic-installed callback' ); @@ -42,7 +40,7 @@ throws_ok ( sub { $dbh->do ('INSERT INTO nonexistent_table VALUES (1)') }, - qr/DBI Exception.+unhandled by DBIC.+no such table/, + qr/DBI Exception.+unhandled by DBIC.+no such table.+nonexistent_table/s, 'callback works after $schema is gone' ); }