minitest / latest / minitest / reportable.html

module Minitest::Reportable

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

Public Instance Methods

error?() Show source
# File lib/minitest.rb, line 558
def error?
  self.failures.any? { |f| UnexpectedError === f }
end

Did this run error?

location() Show source
# File lib/minitest.rb, line 532
def location
  loc = " [#{self.failure.location}]" unless passed? or error?
  "#{self.class_name}##{self.name}#{loc}"
end

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

passed?() Show source
# File lib/minitest.rb, line 524
def passed?
  not self.failure
end

Did this run pass?

Note: skipped runs are not considered passing, but they don’t cause the process to exit non-zero.

result_code() Show source
# File lib/minitest.rb, line 544
def result_code
  self.failure and self.failure.result_code or "."
end

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

skipped?() Show source
# File lib/minitest.rb, line 551
def skipped?
  self.failure and Skip === self.failure
end

Was this run skipped?

© Ryan Davis, seattle.rb
Licensed under the MIT License.
https://docs.seattlerb.org/minitest/Minitest/Reportable.html