Class: Kaisoku::Adapters::CucumberAdapter

Inherits:
Kaisoku::Adapter show all
Defined in:
lib/kaisoku/adapters/cucumber.rb

Constant Summary collapse

ADAPTER_NAME =
'cucumber'

Instance Attribute Summary

Attributes inherited from Kaisoku::Adapter

#configuration

Instance Method Summary collapse

Methods inherited from Kaisoku::Adapter

#after_fork, #before_fork, #initialize, #supports_dry_run?

Constructor Details

This class inherits a constructor from Kaisoku::Adapter

Instance Method Details

#discover(paths = nil) ⇒ Object



10
11
12
# File 'lib/kaisoku/adapters/cucumber.rb', line 10

def discover(paths = nil)
  feature_files(paths).flat_map { |file| scenarios_in(file) }
end

#entity_granularityObject



25
26
27
# File 'lib/kaisoku/adapters/cucumber.rb', line 25

def entity_granularity
  :scenario
end

#run(entities, reporter:, &lifecycle) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/kaisoku/adapters/cucumber.rb', line 14

def run(entities, reporter:, &lifecycle)
  lifecycle ||= proc {}

  entities.each do |entity|
    started_at = monotonic_milliseconds
    lifecycle.call(:entity_started, entity, {})
    ok = run_cucumber(execution_target(entity))
    lifecycle.call(:entity_finished, entity, result_payload(ok, started_at))
  end
end