Module: Cucumber::Events

Defined in:
lib/cucumber/events.rb,
lib/cucumber/events/step_activated.rb,
lib/cucumber/events/test_run_started.rb,
lib/cucumber/events/test_case_started.rb,
lib/cucumber/events/test_run_finished.rb,
lib/cucumber/events/test_step_started.rb,
lib/cucumber/events/test_case_finished.rb,
lib/cucumber/events/test_step_finished.rb,
lib/cucumber/events/gherkin_source_read.rb,
lib/cucumber/events/step_definition_registered.rb

Overview

Events tell you what's happening while Cucumber runs your features.

They're designed to be read-only, appropriate for writing formatters and other output tools. If you need to be able to influence the result of a scenario, use a hook instead.

To subscribe to an event, use Configuration#on_event

Examples:

AfterConfiguration do |config|
  config.on_event :test_case_finished do |event|
    puts event.result
  end
end

Defined Under Namespace

Classes: GherkinSourceRead, StepActivated, StepDefinitionRegistered, TestCaseFinished, TestCaseStarted, TestRunFinished, TestRunStarted, TestStepFinished, TestStepStarted

Class Method Summary collapse

Class Method Details

.make_event_busObject



21
22
23
# File 'lib/cucumber/events.rb', line 21

def self.make_event_bus
  Core::EventBus.new(registry)
end

.registryObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cucumber/events.rb', line 25

def self.registry
  Core::Events.build_registry(
    TestCaseStarted,
    TestCaseFinished,
    TestStepFinished,
    TestStepStarted,
    StepDefinitionRegistered,
    StepActivated,
    TestRunFinished,
    GherkinSourceRead,
    TestRunStarted
  )
end