minitest / 5.11.3 / minitest / result.html /

class Minitest::Result

Parent:
Minitest::Runnable
Included modules:
Minitest::Reportable

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 ::from you can be reasonably sure that the test result can be marshalled.

Attributes

klass [RW]

The class name of the test result.

source_location [RW]

The location of the test method.

Public Class Methods

from (runnable) Show source
# File lib/minitest.rb, line 515
def self.from runnable
  o = runnable

  r = self.new o.name
  r.klass      = o.class.name
  r.assertions = o.assertions
  r.failures   = o.failures.dup
  r.time       = o.time

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

  r
end

Create a new test result from a Runnable instance.

© Ryan Davis, seattle.rb
Licensed under the MIT License.