Exception: Spectus::Result::Fail Private

Inherits:
StandardError
  • Object
show all
Includes:
Base
Defined in:
lib/spectus/result/fail.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The class that is responsible for reporting that the expectation is false.

Instance Attribute Summary

Attributes included from Base

#actual, #challenge, #context, #error, #expected, #got, #level, #subject

Instance Method Summary collapse

Methods included from Base

#initialize, #negate?, #to_h, #valid?

Instance Method Details

#result?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The value of the expectation of the spec.

Returns:

  • (Boolean)

    the spec was false.



12
13
14
# File 'lib/spectus/result/fail.rb', line 12

def result?
  false
end

#to_charString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Identify the state of the result.

Returns:

  • (String)

    the char that identify the state of the result.



19
20
21
22
23
24
25
# File 'lib/spectus/result/fail.rb', line 19

def to_char
  if error.nil?
    'F'
  else
    'E'
  end
end