Class: Cucumber::Filters::BroadcastTestRunStartedEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/filters/broadcast_test_run_started_event.rb

Overview

Added at the end of the filter chain to broadcast a list of all of the test cases that have made it through the filters.

Instance Method Summary collapse

Constructor Details

#initialize(config, receiver = nil) ⇒ BroadcastTestRunStartedEvent


8
9
10
11
# File 'lib/cucumber/filters/broadcast_test_run_started_event.rb', line 8

def initialize(config, receiver = nil)
  super
  @test_cases = []
end

Instance Method Details

#doneObject


18
19
20
21
22
23
24
25
# File 'lib/cucumber/filters/broadcast_test_run_started_event.rb', line 18

def done
  config.notify :test_run_started, @test_cases
  @test_cases.map do |test_case|
    test_case.describe_to(@receiver)
  end
  super
  self
end

#test_case(test_case) ⇒ Object


13
14
15
16
# File 'lib/cucumber/filters/broadcast_test_run_started_event.rb', line 13

def test_case(test_case)
  @test_cases << test_case
  self
end