X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746sybase.t;h=9fc87f066da817193e9e8852a470ea4ecef41371;hb=67810cf454129cb28562cbe0240bb010495e5860;hp=f09862f578f48cbd1e0257f83847f51e95538f5a;hpb=d29565e0c545871399b0732e7781ea445e7d5b8c;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746sybase.t b/t/746sybase.t index f09862f..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,13 +11,21 @@ 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}); +# start disconnected to test reconnection $schema->storage->ensure_connected; +$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") };