A platform for community discussion. Free, open, simple.
DEV: Add parallel spec support to autospec
David Taylor25feb287b8a4
diff --git a/lib/autospec/simple_runner.rb b/lib/autospec/simple_runner.rbindex 24150c96f54..f0606838942 100644--- a/lib/autospec/simple_runner.rb+++ b/lib/autospec/simple_runner.rb@@ -15,7 +15,17 @@ module Autospecend# we use our custom rspec formatterargs = ["-r", "#{File.dirname(__FILE__)}/formatter.rb",- "-f", "Autospec::Formatter", specs.split].flatten.join(" ")+ "-f", "Autospec::Formatter"]++ command = begin+ if ENV["PARALLEL_SPEC"] &&+ !specs.split.any? { |s| puts s; s =~ /\:/ } # Parallel spec can't run specific groups+ "parallel_rspec -- #{args.join(" ")} -- #{specs.split.join(" ")}"+ else+ "bin/rspec #{args.join(" ")} #{specs.split.join(" ")}"+ end+ end+# launch rspecDir.chdir(Rails.root) doenv = { "RAILS_ENV" => "test" }@@ -25,7 +35,7 @@ module Autospecendpid =@mutex.synchronize do- @pid = Process.spawn(env, "bin/rspec #{args}")+ @pid = Process.spawn(env, command)end_, status = Process.wait2(pid)