Fixed minor problem with txn scope guard - rollback exceptions were never reported
[dbsrgits/DBIx-Class.git] / t / 74mssql.t
index 55d599f..c93aee0 100644 (file)
@@ -23,8 +23,8 @@ my $TESTS = 13;
 plan tests => $TESTS * 2;
 
 my @storage_types = (
-  'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server',
-  'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars',
+  'DBI::Sybase::Microsoft_SQL_Server',
+  'DBI::Sybase::Microsoft_SQL_Server::NoBindVars',
 );
 my $storage_idx = -1;
 my $schema;
@@ -35,7 +35,7 @@ for my $storage_type (@storage_types) {
   $schema = DBICTest::Schema->clone;
 
   if ($storage_idx != 0) { # autodetect
-    $schema->storage_type($storage_type);
+    $schema->storage_type("::$storage_type");
   }
 
   $schema->connection($dsn, $user, $pass);
@@ -48,7 +48,7 @@ for my $storage_type (@storage_types) {
     next;
   }
 
-  isa_ok($schema->storage, $storage_type);
+  isa_ok($schema->storage, "DBIx::Class::Storage::$storage_type");
 
 # start disconnected to test reconnection
   $schema->storage->_dbh->disconnect;
@@ -103,12 +103,10 @@ for my $storage_type (@storage_types) {
       my ($storage, $dbh) = @_;
       eval { $dbh->do("DROP TABLE money_test") };
       $dbh->do(<<'SQL');
-
   CREATE TABLE money_test (
      id INT IDENTITY PRIMARY KEY,
      amount MONEY NULL
   )
-
 SQL
 
   });
@@ -120,19 +118,21 @@ SQL
     $row = $rs->create({ amount => 100 });
   } 'inserted a money value';
 
-  is $rs->find($row->id)->amount, 100, 'money value round-trip';
+  cmp_ok $rs->find($row->id)->amount, '==', 100, 'money value round-trip';
 
   lives_ok {
     $row->update({ amount => 200 });
   } 'updated a money value';
 
-  is $rs->find($row->id)->amount, 200, 'updated money value round-trip';
+  cmp_ok $rs->find($row->id)->amount, '==', 200,
+    'updated money value round-trip';
 
   lives_ok {
     $row->update({ amount => undef });
   } 'updated a money value to NULL';
 
-  is $rs->find($row->id)->amount, undef,'updated money value to NULL round-trip';
+  is $rs->find($row->id)->amount,
+    undef, 'updated money value to NULL round-trip';
 }
 
 # clean up our mess