Skip to content

Instantly share code, notes, and snippets.

View nicoolas25's full-sized avatar

Nicolas Zermati nicoolas25

View GitHub Profile
module ForkedSpecs
def forked_specs(*specs)
ActiveRecord::Base.clear_all_connections!
pids = []
specs.each do |spec|
pids << fork do
ActiveRecord::Base.establish_connection
spec.call
end