Class: SQLite3::TestDeprecated
- Defined in:
- lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb,
lib/sqlite3-1.5.3-x86_64-darwin/test/test_deprecated.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Instance Method Summary collapse
- #setup ⇒ Object
- #teardown ⇒ Object
- #test_execute_with_many_bind_params ⇒ Object
- #test_execute_with_many_bind_params_not_nil ⇒ Object
- #test_execute_with_nil_bind_params ⇒ Object
- #test_query_with_many_bind_params ⇒ Object
- #test_query_with_many_bind_params_not_nil ⇒ Object
- #test_query_with_nil_bind_params ⇒ Object
Methods inherited from TestCase
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
5 6 7 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 5 def db @db end |
Instance Method Details
#setup ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 7 def setup super @warn_before = $-w $-w = false @db = SQLite3::Database.new(':memory:') @db.execute 'CREATE TABLE test_table (name text, age int)' end |
#teardown ⇒ Object
15 16 17 18 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 15 def teardown super $-w = @warn_before end |
#test_execute_with_many_bind_params ⇒ Object
36 37 38 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 36 def test_execute_with_many_bind_params assert_equal [[nil, 1]], @db.execute("select ?, ?", nil, 1) end |
#test_execute_with_many_bind_params_not_nil ⇒ Object
24 25 26 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 24 def test_execute_with_many_bind_params_not_nil assert_equal [[1, 2]], @db.execute("select ?, ?", 1, 2).to_a end |
#test_execute_with_nil_bind_params ⇒ Object
40 41 42 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 40 def test_execute_with_nil_bind_params assert_equal [['foo']], @db.execute("select 'foo'", nil) end |
#test_query_with_many_bind_params ⇒ Object
28 29 30 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 28 def test_query_with_many_bind_params assert_equal [[nil, 1]], @db.query("select ?, ?", nil, 1).to_a end |
#test_query_with_many_bind_params_not_nil ⇒ Object
20 21 22 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 20 def test_query_with_many_bind_params_not_nil assert_equal [[1, 2]], db.query('select ?, ?', 1, 2).to_a end |
#test_query_with_nil_bind_params ⇒ Object
32 33 34 |
# File 'lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb', line 32 def test_query_with_nil_bind_params assert_equal [['foo']], @db.query("select 'foo'", nil).to_a end |