lib/parallel_rspec/tasks.rake in parallel_rspec-2.4.1 vs lib/parallel_rspec/tasks.rake in parallel_rspec-2.4.2

- old
+ new

@@ -38,10 +38,16 @@ ActiveRecord::Tasks::DatabaseTasks.load_schema_for ActiveRecord::Base.configurations['test'], :ruby, ENV['SCHEMA'] end end ensure if should_reconnect - ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test']) + if ActiveRecord::Base.configurations.respond_to?(:configs_for) + ActiveRecord::Base.configurations.configs_for(env_name: 'test').each do |configuration| + ActiveRecord::Base.establish_connection(configuration) + end + else + ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test']) + end end end end desc "Recreate the test databases from an existent structure.sql file"