Module: Cucumber::Core::Events

Defined in:
lib/cucumber/core/events.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})


88
89
90
# File 'lib/cucumber/core/events.rb', line 88

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.



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/cucumber/core/events.rb', line 68

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