Exception: Minitest::Assertion
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
#location ⇒ Object
Where was this run before an assertion was raised?
961 962 963 964 965 966 |
# File 'lib/minitest.rb', line 961 def location bt = Minitest.filter_backtrace self.backtrace idx = bt.rindex { |s| s.match? RE } || -1 # fall back to first item bt[idx+1].sub(/:in .*$/, "") end |
#result_code ⇒ Object
:nodoc:
968 969 970 |
# File 'lib/minitest.rb', line 968 def result_code # :nodoc: result_label[0, 1] end |
#result_label ⇒ Object
:nodoc:
972 973 974 |
# File 'lib/minitest.rb', line 972 def result_label # :nodoc: "Failure" end |