From: Rafael Kitover Date: Thu, 2 Jul 2009 19:06:32 +0000 (+0000) Subject: add sybase reconnect test X-Git-Tag: v0.08108~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1c7e85390058cccd1553636b95f3dd288bb20bf;p=dbsrgits%2FDBIx-Class.git add sybase reconnect test --- diff --git a/t/746sybase.t b/t/746sybase.t index 2d42130..9fc87f0 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -2,6 +2,7 @@ use strict; use warnings; use Test::More; +use Test::Exception; use lib qw(t/lib); use DBICTest; @@ -10,7 +11,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/} plan skip_all => 'Set $ENV{DBICTEST_SYBASE_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => 12; +plan tests => 13; my $schema = DBICTest::Schema->connect($dsn, $user, $pass, {AutoCommit => 1}); @@ -20,6 +21,11 @@ $schema->storage->_dbh->disconnect; isa_ok( $schema->storage, 'DBIx::Class::Storage::DBI::Sybase' ); +my $dbh; +lives_ok (sub { + $dbh = $schema->storage->dbh; +}, 'reconnect works'); + $schema->storage->dbh_do (sub { my ($storage, $dbh) = @_; eval { $dbh->do("DROP TABLE artist") };