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;
$schema = DBICTest::Schema->clone;
if ($storage_idx != 0) { # autodetect
- $schema->storage_type($storage_type);
+ $schema->storage_type("::$storage_type");
}
$schema->connection($dsn, $user, $pass);
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;
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 $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