Exception: Expresenter::Fail
- Inherits:
-
StandardError
- Object
- StandardError
- Expresenter::Fail
- Includes:
- Base
- Defined in:
- lib/expresenter/fail.rb
Overview
The class that is responsible for reporting that the expectation is false.
Instance Attribute Summary
Attributes included from Base
#actual, #error, #expected, #got, #level, #matcher
Class Method Summary collapse
Instance Method Summary collapse
-
#char ⇒ String
Express the result with one char.
-
#emoji ⇒ String
Express the result with one emoji.
-
#failed? ⇒ Boolean
Did the test fail?.
-
#failure? ⇒ Boolean
The state of failure.
-
#info? ⇒ Boolean
The state of info.
-
#to_sym ⇒ Symbol
Identify the state of the result.
-
#warning? ⇒ Boolean
The state of warning.
Methods included from Base
#colored_char, #colored_string, #definition, #error?, #initialize, #inspect, #maybe_negate, #negate?, #passed?, #success?, #summary, #titre, #to_s, #valid?
Class Method Details
.with(**details) ⇒ Object
11 12 13 |
# File 'lib/expresenter/fail.rb', line 11 def self.with(**details) raise new(**details) end |
Instance Method Details
#char ⇒ String
Express the result with one char.
53 54 55 56 57 58 59 |
# File 'lib/expresenter/fail.rb', line 53 def char if failure? "F" else "E" end end |
#emoji ⇒ String
Express the result with one emoji.
64 65 66 67 68 69 70 |
# File 'lib/expresenter/fail.rb', line 64 def emoji if failure? "❌" else "💥" end end |
#failed? ⇒ Boolean
Did the test fail?
18 19 20 |
# File 'lib/expresenter/fail.rb', line 18 def failed? true end |
#failure? ⇒ Boolean
The state of failure.
25 26 27 |
# File 'lib/expresenter/fail.rb', line 25 def failure? !error? end |
#info? ⇒ Boolean
The state of info.
32 33 34 |
# File 'lib/expresenter/fail.rb', line 32 def info? false end |
#to_sym ⇒ Symbol
Identify the state of the result.
46 47 48 |
# File 'lib/expresenter/fail.rb', line 46 def to_sym failure? ? :failure : :error end |
#warning? ⇒ Boolean
The state of warning.
39 40 41 |
# File 'lib/expresenter/fail.rb', line 39 def warning? false end |