Class: RSpec::Signal::Symptom

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/signal/symptom.rb

Overview

One strong diagnostic characteristic pulled out of a failure message.

Symptoms are what the looser "related failures" layer clusters on, and they are deliberately narrow. Every extractor is anchored on a specific phrase produced by a specific library -- an HTTP status mismatch, a missing selector, a route that does not exist -- never on two messages merely resembling each other. A failure that matches nothing has no symptom and joins no cluster, which is the safe direction to be wrong in.

kind    :http_status, :selector, ...  -- which extractor fired
key     the cluster identity; equal keys mean "same symptom"
label   the cluster heading, already human-readable
detail  this failure's own wording of the symptom, for the symptom list

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailObject

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



18
19
20
# File 'lib/rspec/signal/symptom.rb', line 18

def detail
  @detail
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



18
19
20
# File 'lib/rspec/signal/symptom.rb', line 18

def key
  @key
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



18
19
20
# File 'lib/rspec/signal/symptom.rb', line 18

def kind
  @kind
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



18
19
20
# File 'lib/rspec/signal/symptom.rb', line 18

def label
  @label
end

Instance Method Details

#to_hObject



19
# File 'lib/rspec/signal/symptom.rb', line 19

def to_h = { kind: kind, key: key, label: label, detail: detail }