Class: Cucumber::Messages::TestStepResult

Inherits:
Message show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Message::Utils

included

Methods included from Message::Serialization

#to_h, #to_json

Methods included from Message::Deserialization

included

Constructor Details

#initialize(duration: Duration.new, message: nil, status: TestStepResultStatus::UNKNOWN) ⇒ TestStepResult

Returns a new instance of TestStepResult.



1795
1796
1797
1798
1799
1800
1801
1802
1803
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1795

def initialize(
  duration: Duration.new,
  message: nil,
  status: TestStepResultStatus::UNKNOWN
)
  @duration = duration
  @message = message
  @status = status
end

Instance Attribute Details

#durationObject (readonly)

Returns the value of attribute duration.



1789
1790
1791
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1789

def duration
  @duration
end

#messageObject (readonly)

Returns the value of attribute message.



1791
1792
1793
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1791

def message
  @message
end

#statusObject (readonly)

Returns the value of attribute status.



1793
1794
1795
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1793

def status
  @status
end

Class Method Details

.from_h(hash) ⇒ Object

Returns a new TestStepResult from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.

Cucumber::Messages::TestStepResult.from_h(some_hash) # => #<Cucumber::Messages::TestStepResult:0x... ...>


1109
1110
1111
1112
1113
1114
1115
1116
1117
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 1109

def self.from_h(hash)
  return nil if hash.nil?

  self.new(
    duration: Duration.from_h(hash[:duration]),
    message: hash[:message],
    status: hash[:status],
  )
end