X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746mssql.t;h=3e70574e4bf3d9bf6276050e4ad8952c1c3148de;hb=db326a590fb76893c9e57dea0fca59be67ba25de;hp=fd4cc58c34f41eddaf7777492ee879cf10d13df6;hpb=a0dd86798d8077ff1035441888165367b45572e5;p=dbsrgits%2FDBIx-Class-Historic.git 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; }