free_mutant/lib/mutant/killer/forking.rb
Markus Schirp 9533a92bb7 Default to forking killer
* Remove rspec world preserving will never work correctly
* Add new unmutated nodes to noop mutators
2012-12-04 19:38:58 +01:00

40 lines
658 B
Ruby

module Mutant
class Killer
class Forked < self
def initialize(killer, strategy, mutation)
@killer = killer
super(strategy, mutation)
end
def type
@killer.type
end
def run
fork do
@killer.new(strategy, mutation)
end
status = Process.wait2.last
status.exitstatus.zero?
end
end
class Forking < self
include Equalizer.new(:killer)
attr_reader :killer
def initialize(killer)
@killer = killer
end
def new(strategy, mutation)
Forked.new(killer, strategy, mutation)
end
end
end
end