5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/test_runner/backtrace_filter.rb', line 5
def call trace
return trace unless Config.trim_backtraces
entry_point = trace.last
test_runner_root = File.expand_path "../..", __FILE__
first_pass = trace.drop_while do |location|
full_path = File.expand_path location.to_s
full_path.start_with? test_runner_root
end
second_pass = first_pass.take_while do |location|
full_path = File.expand_path location.to_s
not full_path.start_with? test_runner_root
end
second_pass << entry_point unless second_pass.last == entry_point
second_pass
end
|