+use DBIx::Class::Optional::Dependencies -skip_all_without => qw( test_dt test_rdbms_informix );
+
use strict;
use warnings;
use Test::More;
-use Test::Exception;
-use DBIx::Class::Optional::Dependencies ();
use lib qw(t/lib);
use DBICTest;
use Scope::Guard ();
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt')
-. ' and ' .
-DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_informix')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt')
- && DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_informix');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_INFORMIX_${_}" } qw/DSN USER PASS/};
-
-if (not $dsn) {
- plan skip_all => <<'EOF';
-Set $ENV{DBICTEST_INFORMIX_DSN} _USER and _PASS to run this test'.
-Warning: This test drops and creates a table called 'event'";
-EOF
-}
-
my $schema;
{
on_connect_call => [ 'datetime_setup' ],
});
- my $sg = Scope::Guard->new(\&cleanup);
+ my $sg = Scope::Guard->new(sub { cleanup($schema) } );
eval { $schema->storage->dbh->do('DROP TABLE event') };
$schema->storage->dbh->do(<<'SQL');
# clean up our mess
sub cleanup {
+ my $schema = shift;
my $dbh;
eval {
$dbh = $schema->storage->dbh;