lib/testr/config/rails.rb in testr-14.2.0 vs lib/testr/config/rails.rb in testr-14.3.0
- old
+ new
@@ -19,9 +19,15 @@
base = File.basename(path, '_factory.rb')
poly = ActiveSupport::Inflector.pluralize(base)
"{test,spec}/**/{#{base},#{poly}_*}_{test,spec}.rb"
end
+TestR::Config.after_fork_hooks << proc do
+ unless ActiveRecord::Base.connection_config[:database] == ':memory:'
+ ActiveRecord::Base.connection.reconnect!
+ end
+end
+
begin
require 'rails/railtie'
Class.new Rails::Railtie do
config.before_initialize do |app|
if app.config.cache_classes