From: Peter Rabbitson Date: Mon, 13 Jan 2014 11:49:53 +0000 (+0100) Subject: SQLite changed their exception text again X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed5550d36c5771dfb5492b23127f8af9e38254d4;p=dbsrgits%2FDBIx-Class-Historic.git SQLite changed their exception text again --- diff --git a/Changes b/Changes index 1b69b27..bbffd09 100644 --- a/Changes +++ b/Changes @@ -36,6 +36,8 @@ Revision history for DBIx::Class - Fix warning in t/54taint.t with explicitly unset PERL5LIB (RT#91972) * Misc + - Adjust exceptions in tests to accommodate changes in the upcoming + DBD::SQLite based on libsqlite 3.8.2 - Replace $row with $result in all docs to be consistent and to clarify various return values diff --git a/t/multi_create/standard.t b/t/multi_create/standard.t index 5a02947..6c1efd8 100644 --- a/t/multi_create/standard.t +++ b/t/multi_create/standard.t @@ -444,7 +444,11 @@ throws_ok ( sub { #$t->cd($t->new_related('cd', { artist => undef } ) ); #$t->{_rel_in_storage} = 0; $t->insert; -}, qr/cd.artist may not be NULL/, "Exception propogated properly"); +}, qr/DBI Exception.+(?x: + \QNOT NULL constraint failed: cd.artist\E + | + \Qcd.artist may not be NULL\E +)/s, "Exception propogated properly"); lives_ok ( sub { $schema->resultset('CD')->create ({ diff --git a/t/relationship/update_or_create_multi.t b/t/relationship/update_or_create_multi.t index 8710048..c7cce7a 100644 --- a/t/relationship/update_or_create_multi.t +++ b/t/relationship/update_or_create_multi.t @@ -69,7 +69,12 @@ throws_ok { year => 2020, title => 'the best thing since sliced bread', }) -} qr/\Qcd.artist may not be NULL/, 'ambiguous find + create failed'; +} qr/DBI Exception.+(?x: + \QNOT NULL constraint failed: cd.artist\E + | + \Qcd.artist may not be NULL\E +)/s, 'ambiguous find + create failed' +; # expect a create, after a failed search using *only* the # *current* relationship and the unique column constraints diff --git a/t/storage/error.t b/t/storage/error.t index d5980eb..61d6782 100644 --- a/t/storage/error.t +++ b/t/storage/error.t @@ -15,7 +15,11 @@ warnings_are ( sub { sub { $schema->resultset('CD')->create({ title => 'vacation in antarctica' }) }, - qr/DBI Exception.+cd\.artist.+NULL/s + qr/DBI Exception.+(?x: + \QNOT NULL constraint failed: cd.artist\E + | + \Qcd.artist may not be NULL\E + )/s ); # as opposed to some other error }, [], 'No warnings besides exception' );