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.25.1/lib/minitest.rb, line 1029
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