[Bast-commits] r5368 - in DBIx-Class/0.08: branches/stopgap/t trunk/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Jan 29 09:14:31 GMT 2009


Author: ribasushi
Date: 2009-01-29 09:14:31 +0000 (Thu, 29 Jan 2009)
New Revision: 5368

Modified:
   DBIx-Class/0.08/branches/stopgap/t/746mssql.t
   DBIx-Class/0.08/trunk/t/746mssql.t
Log:
Sanify 746mssql.t

Modified: DBIx-Class/0.08/branches/stopgap/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/branches/stopgap/t/746mssql.t	2009-01-29 09:08:51 UTC (rev 5367)
+++ DBIx-Class/0.08/branches/stopgap/t/746mssql.t	2009-01-29 09:14:31 UTC (rev 5368)
@@ -17,11 +17,11 @@
 $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(255),
@@ -29,6 +29,10 @@
    primary key(artistid)
 )
 
+SQL
+
+});
+
 my %seen_id;
 
 # test primary key handling
@@ -58,6 +62,7 @@
 
 # clean up our mess
 END {
+    my $dbh = eval { $schema->storage->_dbh };
     $dbh->do('DROP TABLE artist') if $dbh;
 }
 

Modified: DBIx-Class/0.08/trunk/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/746mssql.t	2009-01-29 09:08:51 UTC (rev 5367)
+++ DBIx-Class/0.08/trunk/t/746mssql.t	2009-01-29 09:14:31 UTC (rev 5368)
@@ -17,11 +17,11 @@
 $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 @@
    primary key(artistid)
 )
 
+SQL
+
+});
+
 my %seen_id;
 
 # fresh $schema so we start unconnected
@@ -62,7 +66,7 @@
 
 # clean up our mess
 END {
-    $dbh = eval { $schema->storage->_dbh };
+    my $dbh = eval { $schema->storage->_dbh };
     $dbh->do('DROP TABLE artist') if $dbh;
 }
 




More information about the Bast-commits mailing list