[Bast-commits] r7234 - DBIx-Class/0.08/trunk/t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Wed Aug 5 18:09:04 GMT 2009


Author: caelum
Date: 2009-08-05 18:09:03 +0000 (Wed, 05 Aug 2009)
New Revision: 7234

Modified:
   DBIx-Class/0.08/trunk/t/746mssql.t
   DBIx-Class/0.08/trunk/t/74mssql.t
Log:
better money value comparison in tests

Modified: DBIx-Class/0.08/trunk/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/746mssql.t	2009-08-05 17:49:51 UTC (rev 7233)
+++ DBIx-Class/0.08/trunk/t/746mssql.t	2009-08-05 18:09:03 UTC (rev 7234)
@@ -161,13 +161,14 @@
   $row = $rs->create({ amount => 100 });
 } 'inserted a money value';
 
-is int($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 int($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 });

Modified: DBIx-Class/0.08/trunk/t/74mssql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/74mssql.t	2009-08-05 17:49:51 UTC (rev 7233)
+++ DBIx-Class/0.08/trunk/t/74mssql.t	2009-08-05 18:09:03 UTC (rev 7234)
@@ -103,12 +103,10 @@
       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,13 +118,14 @@
     $row = $rs->create({ amount => 100 });
   } 'inserted a money value';
 
-  is int($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 int($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 });




More information about the Bast-commits mailing list