Class: Assert::Result::Error
- Defined in:
- lib/assert/result.rb,
lib/assert/result.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(test, exception) ⇒ Error
constructor
error results are generated by raising exceptions in tests.
- #name ⇒ Object
- #to_sym ⇒ Object
-
#trace ⇒ Object
override of the base, always show the full unfiltered backtrace for errors.
Methods inherited from Base
#==, #inspect, #test_name, #to_s
Constructor Details
#initialize(test, exception) ⇒ Error
error results are generated by raising exceptions in tests
199 200 201 202 203 204 205 |
# File 'lib/assert/result.rb', line 199 def initialize(test, exception) if exception.kind_of?(Exception) super(test, "#{exception.} (#{exception.class.name})", exception.backtrace || []) else raise ArgumentError, "generate error results by raising an exception" end end |
Instance Method Details
#error? ⇒ Boolean
207 |
# File 'lib/assert/result.rb', line 207 def error?; true; end |
#name ⇒ Object
210 211 212 |
# File 'lib/assert/result.rb', line 210 def name "Error" end |
#to_sym ⇒ Object
208 |
# File 'lib/assert/result.rb', line 208 def to_sym; :error; end |
#trace ⇒ Object
override of the base, always show the full unfiltered backtrace for errors
215 216 217 |
# File 'lib/assert/result.rb', line 215 def trace self.backtrace.to_s end |