X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F750firebird.t;h=eb4122a5d9ca9ed1247c565ce05e15ec97301532;hb=HEAD;hp=d0923793cdf4a2805f8454c99d7365762cdc366a;hpb=a2f228547345e788da5a047024c41f83513e92b8;p=dbsrgits%2FDBIx-Class.git diff --git a/t/750firebird.t b/t/750firebird.t index d092379..eb4122a 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -1,12 +1,14 @@ +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 Try::Tiny; -use lib qw(t/lib); +use DBIx::Class::_Util 'scope_guard'; +use List::Util 'shuffle'; + use DBICTest; my $env2optdep = { @@ -25,8 +27,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,17 +36,13 @@ plan skip_all => join (' ', my $schema; -for my $prefix (keys %$env2optdep) { SKIP: { - - my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/; +for my $prefix (shuffle keys %$env2optdep) { SKIP: { - 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::Schema->connect($dsn, $user, $pass, { auto_savepoint => 1, quote_names => 1, @@ -54,7 +50,7 @@ for my $prefix (keys %$env2optdep) { SKIP: { }); 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(<next; } 'paged query survived'; - is try { $row->artistid }, 5, 'correct row from paged query'; + is( + eval { $row->artistid }, + 5, + 'correct row from paged query' + ); # DBD bug - if any unfinished statements are present during # DDL manipulation (test blobs below)- a segfault will occur