From: Peter Rabbitson Date: Thu, 29 Jan 2009 09:14:31 +0000 (+0000) Subject: Sanify 746mssql.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c5f77f6c399efc2f78ad310a842e8e8d68aaacf6;p=dbsrgits%2FDBIx-Class-Historic.git Sanify 746mssql.t --- diff --git a/t/746mssql.t b/t/746mssql.t index fd4cc58..3e70574 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -17,11 +17,11 @@ my $schema = DBICTest::Schema->connect($dsn, $user, $pass, {AutoCommit => 1}); $schema->storage->ensure_connected; isa_ok( $schema->storage, 'DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server' ); -my $dbh = $schema->storage->_dbh; +$schema->storage->dbh_do (sub { + my ($storage, $dbh) = @_; + eval { $dbh->do("DROP TABLE artist") }; + $dbh->do(<<'SQL'); -eval { $dbh->do("DROP TABLE artist") }; - - $dbh->do(<<''); CREATE TABLE artist ( artistid INT IDENTITY NOT NULL, name VARCHAR(100), @@ -30,6 +30,10 @@ CREATE TABLE artist ( primary key(artistid) ) +SQL + +}); + my %seen_id; # fresh $schema so we start unconnected @@ -62,7 +66,7 @@ is( $it->next, undef, "next past end of resultset ok" ); # clean up our mess END { - $dbh = eval { $schema->storage->_dbh }; + my $dbh = eval { $schema->storage->_dbh }; $dbh->do('DROP TABLE artist') if $dbh; }