Method: Minitest::Assertion#location

Defined in:
lib/minitest.rb

#locationObject

Where was this run before an assertion was raised?

[View source]

1030
1031
1032
1033
1034
1035
1036
# 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