Class: Minitest::Result
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Runnable
|
|
Instance Chain:
self,
Reportable,
Runnable
|
|
Inherits: |
Minitest::Runnable
|
Defined in: | lib/minitest.rb |
Overview
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.
Class Method Summary
-
.from(runnable)
Create a new test result from a Runnable instance.
Runnable - Inherited
.methods_matching | Returns all instance methods matching the pattern |
.run | Responsible for running all runnable methods in a given class, each in its own instance. |
.run_one_method | Runs a single method and has the reporter record the result. |
.runnable_methods | Each subclass of Runnable is responsible for overriding this method to return all runnable methods. |
.runnables | Returns all subclasses of Runnable. |
Instance Attribute Summary
-
#klass
rw
The class name of the test result.
-
#source_location
rw
The location of the test method.
Reportable - Included
Runnable - Inherited
Instance Method Summary
Reportable - Included
#location | The location identifier of this test. |
#result_code | Returns “.”, “F”, or “E” based on the result of the run. |
Runnable - Inherited
#result_code | Returns a single character string to print based on the result of the run. |
#run | Runs a single method. |
Class Method Details
.from(runnable)
Create a new test result from a Runnable instance.
# File 'lib/minitest.rb', line 523
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
Instance Attribute Details
#klass (rw)
The class name of the test result.
# File 'lib/minitest.rb', line 513
attr_accessor :klass
#source_location (rw)
The location of the test method.
# File 'lib/minitest.rb', line 518
attr_accessor :source_location