Created
April 24, 2012 11:50
-
-
Save benedikt/2479058 to your computer and use it in GitHub Desktop.
Makes spork-rails reload everything nicely
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spork.each_run do | |
if Spork.using_spork? | |
ActionDispatch::Reloader.cleanup! | |
ActionDispatch::Reloader.prepare! | |
FactoryGirl.reload | |
end | |
# This line should only be necessary when you have support files | |
# that use a namespace which is defined somewhere in your application. | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
end | |
# Also, make sure you don't cache classes in the test environment when spork is running: | |
# | |
# config.cache_classes = ENV['DRB'] != 'true' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment