diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-02-11 22:32:21 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-02-14 01:40:31 +0000 |
commit | eab5fb49f839bf19da4c31b35142f9e05d05ed2e (patch) | |
tree | ee3fce043082c8a55932542358120ef9e90a2de1 | |
parent | a7e19b30ca71f62af516675023659be061b2b70a (diff) | |
download | rails-eab5fb49f839bf19da4c31b35142f9e05d05ed2e.tar.gz rails-eab5fb49f839bf19da4c31b35142f9e05d05ed2e.tar.bz2 rails-eab5fb49f839bf19da4c31b35142f9e05d05ed2e.zip |
Fix test/cases/connection_pool_test.rb for sqlite3 in-memory db
-rw-r--r-- | activerecord/test/cases/connection_pool_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb index 0c545b7e9d..7ac14fa8d6 100644 --- a/activerecord/test/cases/connection_pool_test.rb +++ b/activerecord/test/cases/connection_pool_test.rb @@ -6,6 +6,16 @@ module ActiveRecord def setup # Keep a duplicate pool so we do not bother others @pool = ConnectionPool.new ActiveRecord::Base.connection_pool.spec + + if in_memory_db? + # Separate connections to an in-memory database create an entirely new database, + # with an empty schema etc, so we just stub out this schema on the fly. + @pool.with_connection do |connection| + connection.create_table :posts do |t| + t.integer :cololumn + end + end + end end def test_pool_caches_columns |