Sha256: e746475ae16017d696d6d784236544c50d1e6e365cc6c2053b4c3679709ef25d

Contents?: true

Size: 895 Bytes

Versions: 7

Compression:

Stored size: 895 Bytes

Contents

require "parallel_tests/gherkin/runner"

module ParallelTests
  module Cucumber
    class Runner < ParallelTests::Gherkin::Runner
      FAILED_SCENARIO_REGEX = /^cucumber features\/.+:\d+/

      class << self
        def name
          'cucumber'
        end

        def line_is_result?(line)
          super || line =~ FAILED_SCENARIO_REGEX
        end

        def summarize_results(results)
          output = []

          failing_scenarios = results.grep(FAILED_SCENARIO_REGEX)
          if failing_scenarios.any?
            failing_scenarios.unshift("Failing Scenarios:")
            output << failing_scenarios.join("\n")
          end

          output << super

          output.join("\n\n")
        end

        def command_with_seed(cmd, seed)
          cmd = cmd.sub(/\s--order random(:\d*)?/, '')
          "#{cmd} --order random:#{seed}"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
parallel_tests-2.10.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.9.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.8.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.7.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.7.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.6.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.5.0 lib/parallel_tests/cucumber/runner.rb