From 97445a1c24156be0d1747218ab9d6e0123ccce5d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 11 May 2010 17:36:57 -0700 Subject: [PATCH] adding test_deprecated --- Manifest.txt | 3 +++ test/test_deprecated.rb | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/test_deprecated.rb diff --git a/Manifest.txt b/Manifest.txt index f3426738..37383f03 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -28,10 +28,13 @@ lib/sqlite3/value.rb lib/sqlite3/version.rb setup.rb tasks/faq.rake +tasks/gem.rake tasks/native.rake tasks/vendor_sqlite3.rake test/helper.rb test/test_database.rb +test/test_deprecated.rb +test/test_encoding.rb test/test_integration.rb test/test_integration_open_close.rb test/test_integration_pending.rb diff --git a/test/test_deprecated.rb b/test/test_deprecated.rb new file mode 100644 index 00000000..eecef630 --- /dev/null +++ b/test/test_deprecated.rb @@ -0,0 +1,25 @@ +require 'helper' + +module SQLite3 + class TestDeprecated < Test::Unit::TestCase + def setup + @db = SQLite3::Database.new(':memory:') + end + + def test_query_with_many_bind_params + assert_equal [[nil, 1]], @db.query("select ?, ?", nil, 1).to_a + end + + def test_query_with_nil_bind_params + assert_equal [['foo']], @db.query("select 'foo'", nil).to_a + end + + def test_execute_with_many_bind_params + assert_equal [[nil, 1]], @db.execute("select ?, ?", nil, 1) + end + + def test_execute_with_nil_bind_params + assert_equal [['foo']], @db.execute("select 'foo'", nil) + end + end +end