Skip to content

Commit 9f78d3a

Browse files
committed
- Rails' default backtrace filter can't currently work with caller_locations, so reverting back to caller.
[git-p4: depot-paths = "//src/minitest/dev/": change = 14008]
1 parent 4a90528 commit 9f78d3a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/minitest/assertions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def assert_empty obj, msg = nil
199199
end
200200

201201
def _where # :nodoc:
202-
where = Minitest.filter_backtrace(caller_locations).first
203-
[where.path, where.lineno].join ":"
202+
where = Minitest.filter_backtrace(caller).first
203+
where = where.split(/:in /, 2).first # clean up noise
204204
end
205205

206206
E = "" # :nodoc:

lib/minitest/spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def infect_an_assertion meth, new_name, dont_flip = false # :nodoc:
1313
# warn "%-22p -> %p %p" % [meth, new_name, dont_flip]
1414
self.class_eval <<-EOM, __FILE__, __LINE__ + 1
1515
def #{new_name} *args
16-
where = Minitest.filter_backtrace(caller_locations).first
17-
where = [where.path, where.lineno].join ":"
16+
where = Minitest.filter_backtrace(caller).first
17+
where = where.split(/:in /, 2).first # clean up noise
1818
Kernel.warn "DEPRECATED: global use of #{new_name} from #\{where}. Use #{target_obj}.#{new_name} instead. This will fail in Minitest 6."
1919
Minitest::Expectation.new(self, Minitest::Spec.current).#{new_name}(*args)
2020
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy