class Cucumber::Messages::Exception

Represents the Exception message in Cucumber's message protocol.

A simplified representation of an exception

Attributes

message[R]

The message of exception that caused this result. E.g. expected: “a” but was: “b”

type[R]

The type of the exception that caused this result. E.g. “Error” or “org.opentest4j.AssertionFailedError”

Public Class Methods

from_h(hash) click to toggle source

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

Cucumber::Messages::Exception.from_h(some_hash) # => #<Cucumber::Messages::Exception:0x... ...>
# File lib/cucumber/messages.deserializers.rb, line 101
def self.from_h(hash)
  return nil if hash.nil?

  self.new(
    type: hash[:type],
    message: hash[:message],
  )
end
new( type: '', message: nil ) click to toggle source
# File lib/cucumber/messages.dtos.rb, line 244
def initialize(
  type: '',
  message: nil
)
  @type = type
  @message = message
end