Skip to content

Instantly share code, notes, and snippets.

@gregoriokusowski
Created April 1, 2011 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregoriokusowski/898431 to your computer and use it in GitHub Desktop.
Save gregoriokusowski/898431 to your computer and use it in GitHub Desktop.
How to make Spork work with autotest and rspec. Using a sqlite3 in-memory db.
#how to set spork
require 'spork'
Spork.prefork do
#my old spec_helper.rb here ;)
end
Spork.each_run do
load_schema = lambda {
load "#{Rails.root.to_s}/db/schema.rb" # use db agnostic schema by default
# ActiveRecord::Migrator.up('db/migrate') # use migrations
}
silence_stream(STDOUT, &load_schema)
end
@gregoriokusowski
Copy link
Author

  1. add '--drb' to the .rspec file
  2. run 'spork' #not rake exec spork anymore ;P
  3. then run 'autotest'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment