Class: Evilution::Runner::MutationExecutor::MutationRunner Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/runner/mutation_executor/mutation_runner.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(config:, cache:, isolator:) ⇒ MutationRunner

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MutationRunner.



7
8
9
10
11
# File 'lib/evilution/runner/mutation_executor/mutation_runner.rb', line 7

def initialize(config:, cache:, isolator:)
  @config = config
  @cache = cache
  @isolator = isolator
end

Instance Method Details

#call(mutation, integration:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/evilution/runner/mutation_executor/mutation_runner.rb', line 13

def call(mutation, integration:)
  return unparseable_result(mutation) if mutation.unparseable?

  cached = @cache.fetch(mutation)
  return cached if cached

  test_command = ->(m) { integration.call(m) }
  result = @isolator.call(mutation: mutation, test_command: test_command, timeout: @config.timeout)
  @cache.store(mutation, result)
  result
end