Class: CemAcpt::TestRunner::TestResults::TestErrorActionResult
- Inherits:
-
Object
- Object
- CemAcpt::TestRunner::TestResults::TestErrorActionResult
- Defined in:
- lib/cem_acpt/test_runner/test_results.rb
Overview
Wrapper class for an error raised during an action.
Instance Attribute Summary collapse
-
#error ⇒ Object
(also: #result)
readonly
Returns the value of attribute error.
-
#log_formatter ⇒ Object
readonly
Returns the value of attribute log_formatter.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(error, log_formatter = nil) ⇒ TestErrorActionResult
constructor
A new instance of TestErrorActionResult.
- #inspect ⇒ Object
- #results ⇒ Object
- #results? ⇒ Boolean
- #status ⇒ Object (also: #http_status)
- #success? ⇒ Boolean
- #summary ⇒ Object
- #summary? ⇒ Boolean
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(error, log_formatter = nil) ⇒ TestErrorActionResult
Returns a new instance of TestErrorActionResult.
97 98 99 100 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 97 def initialize(error, log_formatter = nil) @error = error @log_formatter = log_formatter end |
Instance Attribute Details
#error ⇒ Object (readonly) Also known as: result
Returns the value of attribute error.
95 96 97 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 95 def error @error end |
#log_formatter ⇒ Object (readonly)
Returns the value of attribute log_formatter.
95 96 97 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 95 def log_formatter @log_formatter end |
Instance Method Details
#error? ⇒ Boolean
103 104 105 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 103 def error? true end |
#inspect ⇒ Object
115 116 117 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 115 def inspect to_s end |
#results ⇒ Object
132 133 134 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 132 def results [summary, "Class: #{@error.class.name}", @error.backtrace.join("\n")] end |
#results? ⇒ Boolean
136 137 138 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 136 def results? true end |
#status ⇒ Object Also known as: http_status
127 128 129 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 127 def status 1 end |
#success? ⇒ Boolean
107 108 109 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 107 def success? false end |
#summary ⇒ Object
140 141 142 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 140 def summary @error. end |
#summary? ⇒ Boolean
144 145 146 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 144 def summary? true end |
#to_h ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 119 def to_h { class: @error.class.name, message: @error., backtrace: @error.backtrace, } end |
#to_s ⇒ Object
111 112 113 |
# File 'lib/cem_acpt/test_runner/test_results.rb', line 111 def to_s "#<#{@error.class.name}:0x#{@error.object_id.to_s(16)}>" end |