Module: Minitest::Reportable
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/minitest.rb |
Overview
Constant Summary
-
BASE_DIR =
Internal use only
# File 'lib/minitest.rb', line 591"#{Dir.pwd}/"
Instance Attribute Summary
-
#error? ⇒ Boolean
readonly
Did this run error?
-
#passed? ⇒ Boolean
readonly
Did this run pass?
-
#skipped? ⇒ Boolean
readonly
Was this run skipped?
Instance Method Summary
-
#location
The location identifier of this test.
-
#result_code
Returns “.”, “F”, or “E” based on the result of the run.
- #class_name Internal use only
Instance Attribute Details
#error? ⇒ Boolean
(readonly)
Did this run error?
# File 'lib/minitest.rb', line 623
def error? self.failures.any? UnexpectedError end
#passed? ⇒ Boolean
(readonly)
Did this run pass?
Note: skipped runs are not considered passing, but they don’t cause the process to exit non-zero.
# File 'lib/minitest.rb', line 587
def passed? not self.failure end
#skipped? ⇒ Boolean
(readonly)
Was this run skipped?
# File 'lib/minitest.rb', line 616
def skipped? self.failure and Skip === self.failure end
Instance Method Details
#class_name
This method is for internal use only.
# File 'lib/minitest.rb', line 602
def class_name # :nodoc: raise NotImplementedError, "subclass responsibility" end
#location
The location identifier of this test. Depends on a method existing called class_name.
# File 'lib/minitest.rb', line 597
def location loc = " [#{self.failure.location.delete_prefix BASE_DIR}]" unless passed? or error? "#{self.class_name}##{self.name}#{loc}" end
#result_code
Returns “.”, “F”, or “E” based on the result of the run.
# File 'lib/minitest.rb', line 609
def result_code self.failure and self.failure.result_code or "." end