Class: Minitest::Result (Ruby 2.7.5)
Description: Class : Minitest::Result - Ruby 2.7.5

### Home Classes Methods

### In Files

- minitest-5.13.0/lib/minitest.rb

### Parent

Minitest::Runnable

### Methods

- ::from

### Included Modules

- Minitest::Reportable

### Files

- History.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- Kernel
- Minitest::AbstractReporter
- Minitest::Assertion
- Minitest::Assertions
- Minitest::BacktraceFilter
- Minitest::BenchSpec
- Minitest::Benchmark
- Minitest::CompositeReporter
- Minitest::Expectations
- Minitest::Guard
- Minitest::Mock
- Minitest::Parallel
- Minitest::Parallel::Executor
- Minitest::PrideIO
- Minitest::PrideLOL
- Minitest::ProgressReporter
- Minitest::Reportable
- Minitest::Result
- Minitest::Skip
- Minitest::Spec
- Minitest::Spec::DSL
- Minitest::Spec::DSL::InstanceMethods
- Minitest::StatisticsReporter
- Minitest::SummaryReporter
- Minitest::Test
- Minitest::Test::LifecycleHooks
- Minitest::UnexpectedError
- Object
- SubThingySpec
- ThingySpec

No matching classes.

# 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.

### Attributes

klass[RW]

The class name of the test result.

source_location[RW]

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 = 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