lib/parallel_tests/tasks.rb in parallel_tests-2.14.0 vs lib/parallel_tests/tasks.rb in parallel_tests-2.14.1
- old
+ new
@@ -6,10 +6,12 @@
def rails_env
ENV['RAILS_ENV'] || 'test'
end
def purge_before_load
- "db:test:purge" if Gem::Version.new(Rails.version) > Gem::Version.new('4.2.0')
+ if Gem::Version.new(Rails.version) > Gem::Version.new('4.2.0')
+ Rake::Task.task_defined?('db:test:purge') ? 'db:test:purge' : 'app:db:test:purge'
+ end
end
def run_in_parallel(cmd, options={})
count = " -n #{options[:count]}" unless options[:count].to_s.empty?
executable = File.expand_path("../../../bin/parallel_test", __FILE__)