Skip to content

Commit

Permalink
Use match instead of =~
Browse files Browse the repository at this point in the history
  • Loading branch information
orien committed Jan 13, 2025
1 parent 4a77f10 commit 645a442
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cucumber/formatter/backtrace_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def exception

if ::ENV['CUCUMBER_TRUNCATE_OUTPUT']
# Strip off file locations
regexp = /(.*):in (?:'|`)/
filtered = filtered.map do |line|
line =~ /(.*):in ('|`)/ ? Regexp.last_match(1) : line
match = regexp.match(line)
match ? match[1] : line
end
end

Expand Down

0 comments on commit 645a442

Please sign in to comment.