X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F750firebird.t;h=fac50d560fb325fe195b61c6d39830bc0d8a5d2b;hb=63ee8b7896e02ee888eb26251fc28311721832c5;hp=c1e625a8d81bf6a20f48961210f338d24de70d8b;hpb=2c2bc4e58c2146670960fc1a0a2ae802cb650506;p=dbsrgits%2FDBIx-Class.git diff --git a/t/750firebird.t b/t/750firebird.t index c1e625a..fac50d5 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -1,12 +1,15 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use DBIx::Class::Optional::Dependencies (); -use Scope::Guard (); +use DBIx::Class::_Util 'scope_guard'; +use List::Util 'shuffle'; use Try::Tiny; -use lib qw(t/lib); + use DBICTest; my $env2optdep = { @@ -25,8 +28,6 @@ plan skip_all => join (' ', 'and "nonpkid_seq" and the trigger "artist_bi".', ) unless grep { $ENV{"${_}_DSN"} } keys %$env2optdep; -# tests stolen from 749sybase_asa.t - # Example DSNs: # dbi:Firebird:db=/var/lib/firebird/2.5/data/hlaghdb.fdb # dbi:InterBase:db=/var/lib/firebird/2.5/data/hlaghdb.fdb @@ -36,25 +37,21 @@ plan skip_all => join (' ', my $schema; -for my $prefix (keys %$env2optdep) { SKIP: { +for my $prefix (shuffle keys %$env2optdep) { SKIP: { - my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/; - - next unless $dsn; + DBIx::Class::Optional::Dependencies->skip_without( $env2optdep->{$prefix} ); + my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/; 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}); - - $schema = DBICTest->connect_schema($dsn, $user, $pass, { + $schema = DBICTest::Schema->connect($dsn, $user, $pass, { auto_savepoint => 1, quote_names => 1, ($dsn !~ /ODBC/ ? (on_connect_call => 'use_softcommit') : ()), }); my $dbh = $schema->storage->dbh; - my $sg = Scope::Guard->new(sub { cleanup($schema) }); + my $sg = scope_guard { cleanup($schema) }; eval { $dbh->do(q[DROP TABLE "artist"]) }; $dbh->do(<