Class: Minitest::Result
- Includes:
- Reportable
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/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.
Constant Summary
Constants inherited from Runnable
Instance Attribute Summary collapse
-
#klass ⇒ Object
The class name of the test result.
-
#source_location ⇒ Object
The location of the test method.
Attributes inherited from Runnable
Class Method Summary collapse
-
.from(runnable) ⇒ Object
Create a new test result from a Runnable instance.
Instance Method Summary collapse
-
#class_name ⇒ Object
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Methods included from Reportable
#error?, #location, #passed?, #result_code, #skipped?
Methods inherited from Runnable
#failure, inherited, #initialize, #marshal_dump, #marshal_load, methods_matching, #name, #name=, on_signal, #passed?, reset, #result_code, run, #run, run_one_method, runnable_methods, runnables, #skipped?, #time_it, #whatever, with_info_handler
Constructor Details
This class inherits a constructor from Minitest::Runnable
Instance Attribute Details
#klass ⇒ Object
The class name of the test result.
537 538 539 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 537 def klass @klass end |
#source_location ⇒ Object
The location of the test method.
542 543 544 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 542 def source_location @source_location end |
Class Method Details
.from(runnable) ⇒ Object
Create a new test result from a Runnable instance.
547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 547 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 Method Details
#class_name ⇒ Object
:nodoc:
561 562 563 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 561 def class_name # :nodoc: self.klass # for Minitest::Reportable end |
#to_s ⇒ Object
:nodoc:
565 566 567 568 569 570 571 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/minitest-5.17.0/lib/minitest.rb', line 565 def to_s # :nodoc: return location if passed? and not skipped? failures.map { |failure| "#{failure.result_label}:\n#{self.location}:\n#{failure.}\n" }.join "\n" end |