From: Peter Rabbitson Date: Mon, 14 Dec 2015 10:40:21 +0000 (+0100) Subject: Throw away remnant commented out in 36099e8c X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d2033c32e2efba74edab1cd83814fe8ec1f7a33;hp=35cf7d1af791226b0acfea95828c003e64bf4975;p=dbsrgits%2FDBIx-Class.git Throw away remnant commented out in 36099e8c The stuff being tested is too touchy already to try adding extra sugar to the test. If anything further moving away from Test::* might be in order. --- diff --git a/t/storage/txn_scope_guard.t b/t/storage/txn_scope_guard.t index 2df2ab6..342f0a7 100644 --- a/t/storage/txn_scope_guard.t +++ b/t/storage/txn_scope_guard.t @@ -90,10 +90,8 @@ use DBICTest; { my $schema = DBICTest->init_schema; - no strict 'refs'; no warnings 'redefine'; - - local *{DBIx::Class::Storage::DBI::txn_rollback} = sub { die 'die die my darling' }; + local *DBIx::Class::Storage::DBI::txn_rollback = sub { die 'die die my darling' }; Class::C3->reinitialize() if DBIx::Class::_ENV_::OLD_MRO; throws_ok (sub { @@ -122,32 +120,10 @@ for my $post_poison (0,1) { my $schema = DBICTest->init_schema(no_populate => 1); - no strict 'refs'; no warnings 'redefine'; - local *{DBIx::Class::Storage::DBI::txn_rollback} = sub { die 'die die my darling' }; + local *DBIx::Class::Storage::DBI::txn_rollback = sub { die 'die die my darling' }; Class::C3->reinitialize() if DBIx::Class::_ENV_::OLD_MRO; -#The warn from within a DESTROY callback freaks out Test::Warn, do it old-school -=begin - warnings_exist ( - sub { - my $guard = $schema->txn_scope_guard; - $schema->resultset ('Artist')->create ({ name => 'bohhoo'}); - - # this should freak out the guard rollback - # but it won't work because DBD::SQLite is buggy - # instead just install a toxic rollback above - #$schema->storage->_dbh( $schema->storage->_dbh->clone ); - }, - [ - qr/A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back./, - qr/\*+ ROLLBACK FAILED\!\!\! \*+/, - ], - 'proper warnings generated on out-of-scope+rollback failure' - ); -=cut - -# delete this once the above works properly (same test) my @want = ( qr/A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back./, qr/\*+ ROLLBACK FAILED\!\!\! \*+/,