Sha256: 3abca7cde3e15bf715fc8728a01735ec58c84b29f4361a605c2d40317bb6d14b

Contents?: true

Size: 903 Bytes

Versions: 15

Compression:

Stored size: 903 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)
          clean = cmd.sub(/\s--order\s+random(:\d+)?\b/, '')
          "#{clean} --order random:#{seed}"
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
parallel_tests-2.20.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.19.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.18.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.17.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.17.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.16.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.16.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.15.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.14.3 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.14.2 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.14.1 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.14.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.13.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.12.0 lib/parallel_tests/cucumber/runner.rb
parallel_tests-2.11.0 lib/parallel_tests/cucumber/runner.rb