use Test::More;
use Test::Exception;
+use DBIx::Class::Optional::Dependencies ();
use lib qw(t/lib);
use DBICTest;
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_oracle')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_oracle');
+
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_ORA_${_}" } qw/DSN USER PASS/};
if (not ($dsn && $user && $pass)) {
'Warning: This test drops and creates a table called \'track\'';
}
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_oracle')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_oracle');
-
# DateTime::Format::Oracle needs this set
$ENV{NLS_DATE_FORMAT} = 'DD-MON-YY';
$ENV{NLS_TIMESTAMP_FORMAT} = 'YYYY-MM-DD HH24:MI:SSXFF';
};
$dbh->do("CREATE TABLE track (trackid NUMBER(12), cd NUMBER(12), position NUMBER(12), title VARCHAR(255), last_updated_on DATE, last_updated_at $timestamp_datatype)");
-TODO: {
+# TODO is in effect for the rest of the tests
local $TODO = 'FIXME - something odd is going on with Oracle < 9 datetime support'
if ($schema->storage->_server_info->{normalized_dbms_version}||0) < 9;
+
lives_ok {
# insert a row to play with
is( int $track->last_updated_at->nanosecond, int 500_000_000,
'TIMESTAMP nanoseconds survived' );
-} 'dateteime operations executed correctly' } # end of lives_ok/TODO block
+} 'dateteime operations executed correctly';
done_testing;
# clean up our mess
END {
- if($schema && ($dbh = $schema->storage->dbh)) {
- $dbh->do("DROP TABLE track");
- }
+ if($schema && (my $dbh = $schema->storage->dbh)) {
+ $dbh->do("DROP TABLE track");
+ }
+ undef $schema;
}