module Cucumber::Core::Events

Public Class Methods

build_registry(*types) click to toggle source

Build an event registry to be passed to the {EventBus} constructor from a list of types.

Each type must respond to ‘event_id` so that it can be added to the registry hash.

@return [Hash{Symbol => Class}]

# File lib/cucumber/core/events.rb, line 97
def self.build_registry(*types)
  types.map { |type| [type.event_id, type] }.to_h
end
registry() click to toggle source

The registry contains all the events registered in the core, that will be used by the {EventBus} by default.

# File lib/cucumber/core/events.rb, line 77
def self.registry
  build_registry(
    Envelope,
    GherkinSourceParsed,
    TestStepCreated,
    TestCaseCreated,
    TestCaseStarted,
    TestStepStarted,
    TestStepFinished,
    TestCaseFinished,
  )
end