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, #set_backtrace, #test_name, #to_s
Constructor Details
#initialize(test, exception) ⇒ Error
error results are generated by raising exceptions in tests
144 145 146 147 148 149 150 |
# File 'lib/assert/result.rb', line 144 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
152 |
# File 'lib/assert/result.rb', line 152 def error?; true; end |
#name ⇒ Object
155 156 157 |
# File 'lib/assert/result.rb', line 155 def name "Error" end |
#to_sym ⇒ Object
153 |
# File 'lib/assert/result.rb', line 153 def to_sym; :error; end |
#trace ⇒ Object
override of the base, always show the full unfiltered backtrace for errors
160 161 162 |
# File 'lib/assert/result.rb', line 160 def trace self.backtrace.to_s end |