Module: Mutant::Isolation

Defined in:
lib/mutant/isolation.rb

Overview

Module providing isolationg

Constant Summary collapse

Error =
Class.new(RuntimeError)

Class Method Summary collapse

Class Method Details

.call(&block) ⇒ 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.

Call block in isolation

This isolation implements the fork strategy. Future strategies will probably use a process pool that can handle multiple mutation kills, in-isolation at once.

Returns:

  • (Object)

Raises:



18
19
20
21
22
# File 'lib/mutant/isolation.rb', line 18

def self.call(&block)
  Parallel.map([block], in_processes: 1) do
    block.call
  end.first
end