Skip to content

Commit

Permalink
- Fix situation where Assertion#location can't find the location. (pftg)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 14036]
  • Loading branch information
zenspider committed Jan 24, 2024
1 parent 71dab66 commit 194a70a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/minitest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -961,8 +961,9 @@ def error # :nodoc:
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"

bt[idx+1].sub(/:in .*$/, "")
loc.sub(/:in .*$/, "")

This comment has been minimized.

Copy link
@pftg

pftg Jan 24, 2024

❤️

end

def result_code # :nodoc:
Expand Down

0 comments on commit 194a70a

Please sign in to comment.