lib/parallel_tests/gherkin/runner.rb in parallel_tests-1.0.1 vs lib/parallel_tests/gherkin/runner.rb in parallel_tests-1.0.2
- old
+ new
@@ -5,25 +5,32 @@
module Gherkin
class Runner < ParallelTests::Test::Runner
class << self
def run_tests(test_files, process_number, num_processes, options)
- sanitized_test_files = test_files.map { |val| WINDOWS ? "\"#{val}\"" : Shellwords.escape(val) }
+ combined_scenarios = test_files
+ if options[:group_by] == :scenarios
+ grouped = test_files.map { |t| t.split(':') }.group_by(&:first)
+ combined_scenarios = grouped.map {|file,files_and_lines| "#{file}:#{files_and_lines.map(&:last).join(':')}" }
+ end
+
+ sanitized_test_files = combined_scenarios.map { |val| WINDOWS ? "\"#{val}\"" : Shellwords.escape(val) }
+
options[:env] ||= {}
- options[:env] = options[:env].merge({"AUTOTEST" => "1"}) if $stdout.tty? # display color when we are in a terminal
+ options[:env] = options[:env].merge({'AUTOTEST' => '1'}) if $stdout.tty? # display color when we are in a terminal
cmd = [
executable,
(runtime_logging if File.directory?(File.dirname(runtime_log))),
cucumber_opts(options[:test_options]),
*sanitized_test_files
- ].compact.join(" ")
+ ].compact.join(' ')
execute_command(cmd, process_number, num_processes, options)
end
def test_file_name
- @test_file_name || "feature"
+ @test_file_name || 'feature'
end
def test_suffix
/\.feature$/
end