Method: Minitest::Result.from

Defined in:
lib/minitest.rb

.from(runnable) ⇒ Object

Create a new test result from a Runnable instance.


655
656
657
658
659
660
661
662
663
664
665
666
667
668
# File 'lib/minitest.rb', line 655

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.   = o. if o.metadata?

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

  r
end