8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/evilution/mcp/mutate_tool/survived_enricher.rb', line 8
def self.call(data, survived_results, config)
entries = data["survived"]
return unless entries.is_a?(Array)
explicit_spec = explicit_spec_override(config)
resolver = explicit_spec ? nil : resolver_for_integration(config.integration)
cache = {}
entries.each_with_index do |entry, index|
result = survived_results[index]
next unless result
mutation = result.mutation
entry["subject"] = mutation.subject.name
spec_file = explicit_spec || cache.fetch(mutation.file_path) do
cache[mutation.file_path] = resolver.call(mutation.file_path)
end
entry["spec_file"] = spec_file if spec_file
entry["next_step"] = build_next_step(mutation, spec_file)
end
end
|