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
197 198 199 200 201 202 203 |
# File 'lib/assert/result.rb', line 197 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
205 |
# File 'lib/assert/result.rb', line 205 def error?; true; end |
#name ⇒ Object
208 209 210 |
# File 'lib/assert/result.rb', line 208 def name "Error" end |
#to_sym ⇒ Object
206 |
# File 'lib/assert/result.rb', line 206 def to_sym; :error; end |
#trace ⇒ Object
override of the base, always show the full unfiltered backtrace for errors
213 214 215 |
# File 'lib/assert/result.rb', line 213 def trace self.backtrace.to_s end |