Method: ActiveSupport::TestCase.parallelize_setup
- Defined in:
- lib/active_support/test_case.rb
.parallelize_setup(&block) ⇒ Object
Setup hook for parallel testing. This can be used if you have multiple databases or any behavior that needs to be run after the process is forked but before the tests run.
Note: this feature is not available with the threaded parallelization.
In your test_helper.rb add the following:
class ActiveSupport::TestCase
parallelize_setup do
# create databases
end
end
155 156 157 |
# File 'lib/active_support/test_case.rb', line 155 def parallelize_setup(&block) ActiveSupport::Testing::Parallelization.after_fork_hook(&block) end |