Class: Cucumber::Distrib::Events::TestStepFinished

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

Overview

Object that mimic Cucumber::Event::TestStepFinished on Leader for reporters

Instance Attribute Summary collapse

Attributes inherited from BaseTestStepEvent

#test_step

Instance Method Summary collapse

Methods inherited from Event

event_id, #metadata

Constructor Details

#initialize(event) ⇒ TestStepFinished

Returns a new instance of TestStepFinished.

Parameters:

  • event (Cucumber::Events::TestStepFinished)


421
422
423
424
425
426
427
428
429
430
# File 'lib/cucumber/distrib/events.rb', line 421

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.



418
419
420
# File 'lib/cucumber/distrib/events.rb', line 418

def result
  @result
end

Instance Method Details

#attributesArray<String>

Returns:

  • (Array<String>)


433
434
435
# File 'lib/cucumber/distrib/events.rb', line 433

def attributes
  [test_step, result]
end