10 use_ok( 'DBICTest::Schema' );
12 my $schema = DBICTest->init_schema;
17 $schema->resultset('CD')->create({ title => 'vacation in antarctica' })
19 qr/DBI Exception.+constraint failed.+cd\.artist.+NULL/s
20 ); # as opposed to some other error
21 }, [], 'No warnings besides exception' );
23 my $dbh = $schema->storage->dbh;
27 $dbh->do ('INSERT INTO nonexistent_table VALUES (1)')
29 qr/DBI Exception.+no such table.+nonexistent_table/s,
30 'DBI exceptions properly handled by dbic-installed callback'
33 # This usage is a bit unusual but it was actually seen in the wild
34 # destruction of everything except the $dbh should use the proper
38 if (DBIx::Class::_ENV_::PEEPEENESS()) {
39 skip "Your perl version $] appears to leak like a sieve - skipping garbage collected \$schema test", 1;
45 $dbh->do ('INSERT INTO nonexistent_table VALUES (1)')
47 qr/DBI Exception.+unhandled by DBIC.+no such table.+nonexistent_table/s,
48 'callback works after $schema is gone'