diff options
| author | Rob Holland <rob@inversepath.com> | 2008-05-17 16:05:53 +0100 |
|---|---|---|
| committer | Rob Holland <rob@inversepath.com> | 2008-05-17 16:05:53 +0100 |
| commit | 423e51b081231278ee29dc157f0c19bfd874c275 (patch) | |
| tree | 42c997da73fabdcb7837a26197ef483436ec0b4a /test | |
| parent | a0046a178767af8aee48671898497d2ba953027c (diff) | |
| download | third_party-sqlite3-ruby-423e51b081231278ee29dc157f0c19bfd874c275.tar.gz third_party-sqlite3-ruby-423e51b081231278ee29dc157f0c19bfd874c275.tar.xz third_party-sqlite3-ruby-423e51b081231278ee29dc157f0c19bfd874c275.zip | |
be more granular with time/data translation
Diffstat (limited to 'test')
| -rw-r--r-- | test/tc_integration.rb | 15 |
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 ) |
