mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Exclude also core_assertions.rb from backtraces
This commit is contained in:
parent
3932227d96
commit
fc913ad21d
1 changed files with 3 additions and 2 deletions
|
@ -21,14 +21,15 @@ module Test
|
|||
return ["No backtrace"] unless bt
|
||||
|
||||
new_bt = []
|
||||
pattern = %r[/(?:lib\/test/|core_assertions\.rb:)]
|
||||
|
||||
unless $DEBUG then
|
||||
bt.each do |line|
|
||||
break if line =~ /lib\/test/
|
||||
break if pattern.match?(line)
|
||||
new_bt << line
|
||||
end
|
||||
|
||||
new_bt = bt.reject { |line| line =~ /lib\/test/ } if new_bt.empty?
|
||||
new_bt = bt.reject { |line| pattern.match?(line) } if new_bt.empty?
|
||||
new_bt = bt.dup if new_bt.empty?
|
||||
else
|
||||
new_bt = bt.dup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue