Exception: Spectus::Result::Fail Private
- Inherits:
-
StandardError
- Object
- StandardError
- Spectus::Result::Fail
- 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, #error, #expected, #got, #level, #subject
Instance Method Summary collapse
-
#error? ⇒ Boolean
private
The state of error.
-
#failure? ⇒ Boolean
private
The state of failure.
-
#result? ⇒ Boolean
private
The value of the expectation of the spec.
-
#to_char(color = false) ⇒ String
private
Express the result with one char.
-
#to_sym ⇒ Symbol
private
Identify the state of the result.
Methods included from Base
#initialize, #negate?, #to_h, #valid?
Instance Method Details
#error? ⇒ 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 state of error.
28 29 30 |
# File 'lib/spectus/result/fail.rb', line 28 def error? !failure? end |
#failure? ⇒ 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 state of failure.
21 22 23 |
# File 'lib/spectus/result/fail.rb', line 21 def failure? error.nil? end |
#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.
14 15 16 |
# File 'lib/spectus/result/fail.rb', line 14 def result? false end |
#to_char(color = false) ⇒ String
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.
Express the result with one char.
44 45 46 47 48 49 50 |
# File 'lib/spectus/result/fail.rb', line 44 def to_char(color = false) if failure? color ? "\e[35mF\e[0m" : 'F' else color ? "\e[31mE\e[0m" : 'E' end end |
#to_sym ⇒ Symbol
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.
35 36 37 |
# File 'lib/spectus/result/fail.rb', line 35 def to_sym failure? ? :failure : :error end |