class TestQueue::Runner::Cucumber

Public Class Methods

new() click to toggle source
Calls superclass method TestQueue::Runner::new
# File lib/test_queue/runner/cucumber.rb, line 22
def initialize
  @cli             = ::Cucumber::Cli::Main.new(ARGV.dup)
  @runtime         = ::Cucumber::Runtime.new(@cli.configuration)
  @features_loader = @runtime.send(:features)

  features = @features_loader.is_a?(Array) ? @features_loader : @features_loader.features
  features = features.sort_by { |s| -(stats[s.to_s] || 0) }
  super(features)
end

Public Instance Methods

run_worker(iterator) click to toggle source
# File lib/test_queue/runner/cucumber.rb, line 32
def run_worker(iterator)
  if @features_loader.is_a?(Array)
    @features_loader = iterator
  else
    @features_loader.features = iterator
  end

  @cli.execute!(@runtime)
end
summarize_worker(worker) click to toggle source
# File lib/test_queue/runner/cucumber.rb, line 42
def summarize_worker(worker)
  worker.stats.each do |s, val|
    stats[s.to_s] = val
  end

  output                = worker.output.gsub(/\e\[\d+./, '')
  worker.summary        = output.split("\n").grep(/^\d+ (scenarios?|steps?)/).first
  worker.failure_output = output.scan(/^Failing Scenarios:\n(.*)\n\d+ scenarios?/m).join("\n")
end