Class: Cucumber::Distrib::Events::TestCaseFinished

Inherits:
BaseTestCaseEvent show all
Defined in:
lib/cucumber/distrib/events.rb

Overview

Object that mimic Cucumber::Event::TestCaseFinished on Leader for reporters.

Direct Known Subclasses

RetryingTest

Instance Attribute Summary collapse

Attributes inherited from BaseTestCaseEvent

#test_case

Instance Method Summary collapse

Methods inherited from Event

event_id, #metadata

Constructor Details

#initialize(event) ⇒ TestCaseFinished

Returns a new instance of TestCaseFinished.

Parameters:

  • event (Cucumber::Events::TestCaseFinished)


361
362
363
364
365
366
367
368
369
370
# File 'lib/cucumber/distrib/events.rb', line 361

def initialize(event)
  super

  if event.result.is_a? ::Cucumber::Core::Test::Result::Failed
    exception = ::Cucumber::Distrib::Events::Exception.new(event.result.exception)
    @result = ::Cucumber::Core::Test::Result::Failed.new(event.result.duration, exception)
  else
    @result = event.result
  end
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



358
359
360
# File 'lib/cucumber/distrib/events.rb', line 358

def result
  @result
end

Instance Method Details

#attributesArray<String>

Returns:

  • (Array<String>)


373
374
375
# File 'lib/cucumber/distrib/events.rb', line 373

def attributes
  [test_case, result]
end