Module: Cucumber::Core::Events

Defined in:
lib/cucumber/core/events.rb,
lib/cucumber/core/events/envelope.rb,
lib/cucumber/core/events/test_case_created.rb,
lib/cucumber/core/events/test_case_started.rb,
lib/cucumber/core/events/test_step_created.rb,
lib/cucumber/core/events/test_step_started.rb,
lib/cucumber/core/events/test_case_finished.rb,
lib/cucumber/core/events/test_step_finished.rb,
lib/cucumber/core/events/gherkin_source_parsed.rb

Defined Under Namespace

Classes: Envelope, GherkinSourceParsed, TestCaseCreated, TestCaseFinished, TestCaseStarted, TestStepCreated, TestStepFinished, TestStepStarted

Class Method Summary collapse

Class Method Details

.build_registry(*types) ⇒ Hash{Symbol => Class}

Build an event registry to be passed to the Cucumber::Core::EventBus constructor from a list of types. Each type must respond to event_id so that it can be added to the registry hash

Returns:

  • (Hash{Symbol => Class})


33
34
35
# File 'lib/cucumber/core/events.rb', line 33

def self.build_registry(*types)
  types.to_h { |type| [type.event_id, type] }
end

.registryObject

The registry contains all the events registered in the core, that will be used by the Cucumber::Core::EventBus by default.



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cucumber/core/events.rb', line 16

def self.registry
  build_registry(
    Envelope,
    GherkinSourceParsed,
    TestCaseCreated,
    TestCaseStarted,
    TestCaseFinished,
    TestStepCreated,
    TestStepStarted,
    TestStepFinished
  )
end