From: Peter Rabbitson Date: Tue, 31 Aug 2010 12:13:19 +0000 (+0200) Subject: Entire test suite passes under DBIC_TRACE=1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0007aedf713cd43ec7c96e95209a1c4117a5a851;p=dbsrgits%2FDBIx-Class-Historic.git Entire test suite passes under DBIC_TRACE=1 Explicitly disable debug on some noisy tests (when dealing with blobs) Bump Test::Exception to a version that does not go bizarre copy on you --- diff --git a/Changes b/Changes index 8b9c106..6408d9f 100644 --- a/Changes +++ b/Changes @@ -61,6 +61,7 @@ Revision history for DBIx::Class * Misc - Refactored capability handling in Storage::DBI, allows for standardized capability handling wrt query/enable/disable + - Entire test suite now passes under DBIC_TRACE=1 - Makefile.PL no longer imports GetOptions() to interoperate better with Catalyst installers - Bumped minimum Module::Install for developers diff --git a/Makefile.PL b/Makefile.PL index f10d2d9..b47115c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -48,7 +48,7 @@ my $build_requires = { my $test_requires = { 'File::Temp' => '0.22', 'Test::Builder' => '0.33', - 'Test::Exception' => '0', + 'Test::Exception' => '0.31', 'Test::More' => '0.92', 'Test::Warn' => '0.21', }; diff --git a/t/bind/bindtype_columns.t b/t/bind/bindtype_columns.t index 90ad8c6..0eab861 100644 --- a/t/bind/bindtype_columns.t +++ b/t/bind/bindtype_columns.t @@ -32,6 +32,8 @@ my $dbh = $schema->storage->dbh; ],{ RaiseError => 1, PrintError => 1 }); } +$schema->storage->debug(0); # these tests spew up way too much stuff, disable trace + my $big_long_string = "\x00\x01\x02 abcd" x 125000; my $new; 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' ); }