Module: Cucumber::Events

Defined in:
lib/cucumber/events.rb,
lib/cucumber/events/envelope.rb,
lib/cucumber/events/step_activated.rb,
lib/cucumber/events/test_case_ready.rb,
lib/cucumber/events/test_run_started.rb,
lib/cucumber/events/test_case_created.rb,
lib/cucumber/events/test_case_started.rb,
lib/cucumber/events/test_run_finished.rb,
lib/cucumber/events/test_step_created.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/gherkin_source_parsed.rb,
lib/cucumber/events/hook_test_step_created.rb,
lib/cucumber/events/undefined_parameter_type.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:

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

Defined Under Namespace

Classes: Envelope, GherkinSourceParsed, GherkinSourceRead, HookTestStepCreated, StepActivated, StepDefinitionRegistered, TestCaseCreated, TestCaseFinished, TestCaseReady, TestCaseStarted, TestRunFinished, TestRunStarted, TestStepCreated, TestStepFinished, TestStepStarted, UndefinedParameterType

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
38
39
40
41
42
43
44
# File 'lib/cucumber/events.rb', line 25

def self.registry
  Core::Events.build_registry(
    GherkinSourceParsed,
    GherkinSourceRead,
    HookTestStepCreated,
    StepActivated,
    StepDefinitionRegistered,
    TestCaseCreated,
    TestCaseFinished,
    TestCaseStarted,
    TestCaseReady,
    TestRunFinished,
    TestRunStarted,
    TestStepCreated,
    TestStepFinished,
    TestStepStarted,
    Envelope,
    UndefinedParameterType
  )
end