Exception: Minitest::Assertion
- Inherits:
-
Exception
- Object
- Exception
- Minitest::Assertion
- Defined in:
- lib/minitest.rb
Overview
Represents run failures.
Direct Known Subclasses
Constant Summary collapse
- RE =
:nodoc:
/in [`'](?:[^']+[#.])?(?:assert|refute|flunk|pass|fail|raise|must|wont)/
Instance Method Summary collapse
-
#error ⇒ Object
:nodoc:.
-
#location ⇒ Object
Where was this run before an assertion was raised?.
-
#result_code ⇒ Object
:nodoc:.
-
#result_label ⇒ Object
:nodoc:.
Instance Method Details
#error ⇒ Object
:nodoc:
1042 1043 1044 |
# File 'lib/minitest.rb', line 1042 def error # :nodoc: self end |
#location ⇒ Object
Where was this run before an assertion was raised?
1049 1050 1051 1052 1053 1054 1055 |
# File 'lib/minitest.rb', line 1049 def location bt = Minitest.filter_backtrace self.backtrace idx = bt.rindex { |s| s.match? RE } || -1 # fall back to first item loc = bt[idx+1] || bt.last || "unknown:-1" loc.sub(/:in .*$/, "") end |
#result_code ⇒ Object
:nodoc:
1057 1058 1059 |
# File 'lib/minitest.rb', line 1057 def result_code # :nodoc: result_label[0, 1] end |
#result_label ⇒ Object
:nodoc:
1061 1062 1063 |
# File 'lib/minitest.rb', line 1061 def result_label # :nodoc: "Failure" end |