class Minitest::Assertion

Represents run failures.

Public Instance Methods

location() click to toggle source

Where was this run before an assertion was raised?

# File minitest-5.22.3/lib/minitest.rb, line 972
def location
  bt  = Minitest.filter_backtrace self.backtrace
  idx = bt.rindex { |s| s.match? RE } || -1 # fall back to first item
  loc = bt[idx+1] || bt.last || "unknown:-1"

  loc.sub(/:in .*$/, "")
end