From: Rafael Kitover Date: Wed, 5 Aug 2009 18:09:03 +0000 (+0000) Subject: better money value comparison in tests X-Git-Tag: v0.08109~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a33d2444e0981129eb060521de27c5e2104f37ba;p=dbsrgits%2FDBIx-Class.git better money value comparison in tests --- diff --git a/t/746mssql.t b/t/746mssql.t index 7812d11..40a6157 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -161,13 +161,14 @@ lives_ok { $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 }); diff --git a/t/74mssql.t b/t/74mssql.t index 539ebcd..c93aee0 100644 --- a/t/74mssql.t +++ b/t/74mssql.t @@ -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,13 +118,14 @@ SQL $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 });