Sha256: 24abe975a044af9b946bd976b41de1272c580615e72e7e7b1160e056d362beda
Contents?: true
Size: 1.09 KB
Versions: 6
Compression:
Stored size: 1.09 KB
Contents
require 'cucumber' require 'cucumber/rspec/disable_option_parser' require 'cucumber/cli/main' module Cucumber module Ast class Features attr_accessor :features end class Feature def to_s title end end end end module TestQueue class Runner class Cucumber < Runner def initialize @cli = ::Cucumber::Cli::Main.new(ARGV.dup) @runtime = ::Cucumber::Runtime.new(@cli.configuration) @features_loader = @runtime.send(:features) features = @features_loader.features.sort_by{ |s| -(stats[s.to_s] || 0) } super(features) end def run_worker(iterator) @features_loader.features = iterator @cli.execute!(@runtime) end 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 end end end
Version data entries
6 entries across 6 versions & 2 rubygems