class Minitest::Assertion - minitest: Ruby Standard Library Documentation

# 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.4/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