diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-05 10:08:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-05 10:08:38 -0700 |
commit | 9a08517c8dad9824bc24c1c9874343d3d70b5360 (patch) | |
tree | 72761ce2cb4f529830c0e0d44ec202bc252aebdf /activerecord/test/cases/adapters/sqlite3 | |
parent | 710dcf826a073720b817389fe1b7013fb87be659 (diff) | |
download | rails-9a08517c8dad9824bc24c1c9874343d3d70b5360.tar.gz rails-9a08517c8dad9824bc24c1c9874343d3d70b5360.tar.bz2 rails-9a08517c8dad9824bc24c1c9874343d3d70b5360.zip |
converted exec to exec_query for sqlite
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb index 973c51f3d7..234696adeb 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb @@ -58,24 +58,24 @@ module ActiveRecord end def test_exec_no_binds - @conn.exec('create table ex(id int, data string)') - result = @conn.exec('SELECT id, data FROM ex') + @conn.exec_query('create table ex(id int, data string)') + result = @conn.exec_query('SELECT id, data FROM ex') assert_equal 0, result.rows.length assert_equal 2, result.columns.length assert_equal %w{ id data }, result.columns - @conn.exec('INSERT INTO ex (id, data) VALUES (1, "foo")') - result = @conn.exec('SELECT id, data FROM ex') + @conn.exec_query('INSERT INTO ex (id, data) VALUES (1, "foo")') + result = @conn.exec_query('SELECT id, data FROM ex') assert_equal 1, result.rows.length assert_equal 2, result.columns.length assert_equal [[1, 'foo']], result.rows end - def test_exec_with_binds - @conn.exec('create table ex(id int, data string)') - @conn.exec('INSERT INTO ex (id, data) VALUES (1, "foo")') - result = @conn.exec( + def test_exec_query_with_binds + @conn.exec_query('create table ex(id int, data string)') + @conn.exec_query('INSERT INTO ex (id, data) VALUES (1, "foo")') + result = @conn.exec_query( 'SELECT id, data FROM ex WHERE id = ?', nil, [[nil, 1]]) assert_equal 1, result.rows.length @@ -84,12 +84,12 @@ module ActiveRecord assert_equal [[1, 'foo']], result.rows end - def test_exec_typecasts_bind_vals - @conn.exec('create table ex(id int, data string)') - @conn.exec('INSERT INTO ex (id, data) VALUES (1, "foo")') + def test_exec_query_typecasts_bind_vals + @conn.exec_query('create table ex(id int, data string)') + @conn.exec_query('INSERT INTO ex (id, data) VALUES (1, "foo")') column = @conn.columns('ex').find { |col| col.name == 'id' } - result = @conn.exec( + result = @conn.exec_query( 'SELECT id, data FROM ex WHERE id = ?', nil, [[column, '1-fuu']]) assert_equal 1, result.rows.length |