Class: TestQueue::Runner::Cucumber
- Inherits:
-
TestQueue::Runner
- Object
- TestQueue::Runner
- TestQueue::Runner::Cucumber
- Defined in:
- lib/test_queue/runner/cucumber.rb
Instance Attribute Summary
Attributes inherited from TestQueue::Runner
Instance Method Summary collapse
-
#initialize ⇒ Cucumber
constructor
A new instance of Cucumber.
- #run_worker(iterator) ⇒ Object
- #summarize_worker(worker) ⇒ Object
Methods inherited from TestQueue::Runner
#after_fork, #after_fork_internal, #around_filter, #cleanup_worker, #connect_to_relay, #distribute_queue, #execute, #execute_parallel, #execute_sequential, #prepare, #reap_worker, #relay?, #relay_to_master, #spawn_workers, #start_master, #start_relay, #stats, #stats_file, #stop_master, #summarize, #summarize_internal, #worker_completed
Constructor Details
#initialize ⇒ Cucumber
Returns a new instance of Cucumber.
22 23 24 25 26 27 28 29 30 |
# 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 |
Instance Method Details
#run_worker(iterator) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# 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) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# 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 |