diff options
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb index 0598ff25f8..02834edf7b 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb @@ -34,24 +34,30 @@ module ActiveRecord end def test_connect_with_url - original_connection = ActiveRecord::Base.remove_connection - tf = Tempfile.open 'whatever' - url = "sqlite3://#{tf.path}" - ActiveRecord::Base.establish_connection(url) - assert ActiveRecord::Base.connection - ensure - tf.close - tf.unlink - ActiveRecord::Base.establish_connection(original_connection) + skip "can't establish new connection when using memory db" if in_memory_db? + begin + original_connection = ActiveRecord::Base.remove_connection + tf = Tempfile.open 'whatever' + url = "sqlite3://#{tf.path}" + ActiveRecord::Base.establish_connection(url) + assert ActiveRecord::Base.connection + ensure + tf.close + tf.unlink + ActiveRecord::Base.establish_connection(original_connection) + end end def test_connect_memory_with_url - original_connection = ActiveRecord::Base.remove_connection - url = "sqlite3:///:memory:" - ActiveRecord::Base.establish_connection(url) - assert ActiveRecord::Base.connection - ensure - ActiveRecord::Base.establish_connection(original_connection) + skip "can't establish new connection when using memory db" if in_memory_db? + begin + original_connection = ActiveRecord::Base.remove_connection + url = "sqlite3:///:memory:" + ActiveRecord::Base.establish_connection(url) + assert ActiveRecord::Base.connection + ensure + ActiveRecord::Base.establish_connection(original_connection) + end end def test_valid_column @@ -183,7 +189,7 @@ module ActiveRecord DualEncoding.connection.execute(<<-eosql) CREATE TABLE dual_encodings ( id integer PRIMARY KEY AUTOINCREMENT, - name string, + name varchar(255), data binary ) eosql |