Skip to content

Commit 645a442

Browse files
committed
Use match instead of =~
1 parent 4a77f10 commit 645a442

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/cucumber/formatter/backtrace_filter.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ def exception
4343

4444
if ::ENV['CUCUMBER_TRUNCATE_OUTPUT']
4545
# Strip off file locations
46+
regexp = /(.*):in (?:'|`)/
4647
filtered = filtered.map do |line|
47-
line =~ /(.*):in ('|`)/ ? Regexp.last_match(1) : line
48+
match = regexp.match(line)
49+
match ? match[1] : line
4850
end
4951
end
5052

0 commit comments

Comments
 (0)