sqlite3 in test

How can I setup sqlite3 backed database in test environment with the :memory: driver.

When I run rake test (or rake spec), of course I have no database file created, so there are no tables! rake test in the case of a :memory: backed database must first create the schema.

I seem to remember this was running a while back? thx

This list is for the development of Rails itself, so you may have better luck with these sorts of questions on rails-talk. That said,

How can I setup sqlite3 backed database in test environment with the :memory: driver.

# database.yml

development: &defaults   adapter: sqlite3   database: db/development.sqlite3   pool: 5   timeout: 5000

test:   <<: *defaults   database: ":memory:"

# test/test_helper.rb

if ":memory:" == ActiveRecord::Base.configurations[Rails.env]["database"]   ActiveRecord::Migration.verbose = false   load "db/schema.rb" end

This is on Rails 2.

~ j.