class Minitest::Result

This represents a test result in a clean way that can be marshalled over a wire. Tests can do anything they want to the test instance and can create conditions that cause Marshal.dump to blow up. By using Result.from(a_test) you can be reasonably sure that the test result can be marshalled.



The class name of the test result.


The location of the test method.

Public Class Methods

from(runnable) click to toggle source

Create a new test result from a Runnable instance.

# File minitest-5.13.0/lib/minitest.rb, line 521
def self.from runnable
  o = runnable

  r =
  r.klass      =
  r.assertions = o.assertions
  r.failures   = o.failures.dup
  r.time       = o.time

  r.source_location = o.method( rescue ["unknown", -1]