summaryrefslogtreecommitdiffstats
path: root/test/tc_integration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/tc_integration.rb')
-rw-r--r--test/tc_integration.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/tc_integration.rb b/test/tc_integration.rb
index 6c5789f..85fb27a 100644
--- a/test/tc_integration.rb
+++ b/test/tc_integration.rb
@@ -960,7 +960,7 @@ module Integration
define_method( "test_type_translation_with_null_column" ) do
@db.type_translation = true
- @db.execute "create table bar ( a integer, b datetime, c string )"
+ @db.execute "create table bar ( a integer, b time, c string )"
@db.execute "insert into bar (a, b, c) values (NULL, '1974-07-25 14:39:00', 'hello')"
@db.execute "insert into bar (a, b, c) values (1, NULL, 'hello')"
@db.execute "insert into bar (a, b, c) values (2, '1974-07-25 14:39:00', NULL)"
@@ -971,6 +971,19 @@ module Integration
end
end
+ define_method( "test_date_and_time_translation" ) do
+ @db.type_translation = true
+ @db.execute "create table bar ( a date, b datetime, c time, d timestamp )"
+ @db.execute "insert into bar (a, b, c, d) values ('1999-01-08', '1997-12-17 07:37:16', '07:37:16', '2004-10-19 10:23:54')"
+ @db.query( "select * from bar" ) do |result|
+ result = result.next
+ assert result[0].is_a?(Date)
+ assert result[1].is_a?(DateTime)
+ assert result[2].is_a?(Time)
+ assert result[3].is_a?(Time)
+ end
+ end
+
define_method( "test_next_results_as_hash" ) do
@db.results_as_hash = true
@result.reset( 1 )