module Minitest::Reportable

Shared code for anything that can get passed to a Reporter. See Minitest::Test & Minitest::Result.

Public Instance Methods

error?() click to toggle source

Did this run error?

# File lib/minitest.rb, line 575
def error?
  self.failures.any? { |f| UnexpectedError === f }
location() click to toggle source

The location identifier of this test. Depends on a method existing called class_name.

# File lib/minitest.rb, line 549
def location
  loc = " [#{self.failure.location.delete_prefix BASE_DIR}]" unless passed? or error?
passed?() click to toggle source

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 539
def passed?
  not self.failure
result_code() click to toggle source

Returns “.”, “F”, or “E” based on the result of the run.

# File lib/minitest.rb, line 561
def result_code
  self.failure and self.failure.result_code or "."
skipped?() click to toggle source

Was this run skipped?

# File lib/minitest.rb, line 568
def skipped?
  self.failure and Skip === self.failure