class Minitest::Assertion

Represents run failures.

Public Instance Methods

location() click to toggle source

Where was this run before an assertion was raised?

# File lib/minitest.rb, line 1030
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