$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 });
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
});
$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 });