X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F750firebird.t;h=aef3fcf06000193426e76d927e76646dbdd54e7c;hb=7e1ca6dd06c5e53e7afa3433da0f59e41ce791e8;hp=d55474b64310283f40a87ff3e1a9d1e49f576617;hpb=5346c8ff29968a334e9b3269be7c06c3e3235d08;p=dbsrgits%2FDBIx-Class.git diff --git a/t/750firebird.t b/t/750firebird.t index d55474b..aef3fcf 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -42,6 +42,8 @@ for my $prefix (keys %$env2optdep) { SKIP: { next unless $dsn; + note "Testing with ${prefix}_DSN"; + skip ("Testing with ${prefix}_DSN needs " . DBIx::Class::Optional::Dependencies->req_missing_for( $env2optdep->{$prefix} ), 1) unless DBIx::Class::Optional::Dependencies->req_ok_for($env2optdep->{$prefix}); @@ -52,7 +54,7 @@ for my $prefix (keys %$env2optdep) { SKIP: { }); my $dbh = $schema->storage->dbh; - my $sg = Scope::Guard->new(\&cleanup); + my $sg = Scope::Guard->new(sub { cleanup($schema) }); eval { $dbh->do(q[DROP TABLE "artist"]) }; $dbh->do(<txn_do(sub { + my ($schema, $ars) = @_; eval { $schema->txn_do(sub { $ars->create({ name => 'in_savepoint' }); @@ -135,7 +138,7 @@ EOF 'savepoint rolled back'); $ars->create({ name => 'in_outer_txn' }); die "rolling back outer txn"; - }); + }, $schema, $ars); } qr/rolling back outer txn/, 'correct exception for rollback'; @@ -305,6 +308,8 @@ done_testing; # clean up our mess sub cleanup { + my $schema = shift; + my $dbh; eval { $schema->storage->disconnect; # to avoid object FOO is in use errors