lib/parallel_tests/tasks.rb in parallel_tests-0.13.3 vs lib/parallel_tests/tasks.rb in parallel_tests-0.14.0
- old
+ new
@@ -109,11 +109,11 @@
desc "launch given rake command in parallel"
task :rake, :command do |t, args|
ParallelTests::Tasks.run_in_parallel("RAILS_ENV=#{ParallelTests::Tasks.rails_env} rake #{args.command}")
end
- ['test', 'spec', 'features'].each do |type|
+ ['test', 'spec', 'features', 'features-spinach'].each do |type|
desc "run #{type} in parallel with parallel:#{type}[num_cpus]"
task type, [:count, :pattern, :options] do |t, args|
ParallelTests::Tasks.check_for_pending_migrations
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..'))
@@ -121,18 +121,22 @@
count, pattern, options = ParallelTests::Tasks.parse_args(args)
test_framework = {
'spec' => 'rspec',
'test' => 'test',
- 'features' => 'cucumber'
+ 'features' => 'cucumber',
+ 'features-spinach' => 'spinach',
}[type]
+ if test_framework == 'spinach'
+ type = 'features'
+ end
executable = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'parallel_test')
+
command = "#{executable} #{type} --type #{test_framework} " \
"-n #{count} " \
"--pattern '#{pattern}' " \
"--test-options '#{options}'"
-
abort unless system(command) # allow to chain tasks e.g. rake parallel:spec parallel:features
end
end
end