summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2007-01-30 00:07:47 +0000
committerJamis Buck <jamis@37signals.com>2007-01-30 00:07:47 +0000
commita1472f5339fb163b0ca5a330c8c599e51f0468f0 (patch)
tree8bd8363035d2adbc459d4752c7debd178a3bf134 /test
parent5f4b8ddb1e2f9a36d5d1408c4630a63df49e8aa5 (diff)
downloadthird_party-sqlite3-ruby-a1472f5339fb163b0ca5a330c8c599e51f0468f0.tar.gz
third_party-sqlite3-ruby-a1472f5339fb163b0ca5a330c8c599e51f0468f0.tar.xz
third_party-sqlite3-ruby-a1472f5339fb163b0ca5a330c8c599e51f0468f0.zip
make the table_info method adjust the returned default value for the rows so that the sqlite3 change in 3.3.8 and greater can be handled transparently
Diffstat (limited to 'test')
-rw-r--r--test/tc_integration.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/tc_integration.rb b/test/tc_integration.rb
index 8bb4c4a..9d78313 100644
--- a/test/tc_integration.rb
+++ b/test/tc_integration.rb
@@ -82,6 +82,17 @@ module Integration
assert_nothing_raised { @db.table_info("foo") }
end
+ define_method( "test_table_info_with_defaults_for_version_3_3_8_and_higher" ) do
+ @db.transaction do
+ @db.execute "create table defaults_test ( a string default NULL, b string default 'Hello' )"
+ data = @db.table_info( "defaults_test" )
+ assert_equal({"name" => "a", "type" => "string", "dflt_value" => nil, "notnull" => "0", "cid" => "0", "pk" => "0"},
+ data[0])
+ assert_equal({"name" => "b", "type" => "string", "dflt_value" => "Hello", "notnull" => "0", "cid" => "1", "pk" => "0"},
+ data[1])
+ end
+ end
+
define_method( "test_complete_fail" ) do
assert !@db.complete?( "select * from foo" )
end