2013-07-28 16:03:06 -07:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2012-11-21 22:55:53 +01:00
|
|
|
module Mutant
|
|
|
|
class Killer
|
|
|
|
|
2012-12-12 22:31:14 +01:00
|
|
|
# A killer that executes other killer in forked environemnts
|
2012-11-22 01:42:10 +01:00
|
|
|
class Forking < self
|
|
|
|
include Equalizer.new(:killer)
|
|
|
|
|
2012-12-12 22:31:14 +01:00
|
|
|
# Return killer
|
|
|
|
#
|
|
|
|
# @return [Killer]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-11-22 01:42:10 +01:00
|
|
|
attr_reader :killer
|
|
|
|
|
2012-12-12 22:31:14 +01:00
|
|
|
# Initalize killer
|
|
|
|
#
|
|
|
|
# @param [Killer] killer
|
|
|
|
# the killer that will be used
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-12-04 19:38:58 +01:00
|
|
|
def initialize(killer)
|
2012-11-22 01:42:10 +01:00
|
|
|
@killer = killer
|
|
|
|
end
|
|
|
|
|
2012-12-12 22:31:14 +01:00
|
|
|
# Return killer instance
|
|
|
|
#
|
|
|
|
# @param [Strategy] strategy
|
|
|
|
# @param [Mutation] mutation
|
|
|
|
#
|
|
|
|
# @return [Killer::Forked]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
2012-12-04 19:38:58 +01:00
|
|
|
def new(strategy, mutation)
|
|
|
|
Forked.new(killer, strategy, mutation)
|
2012-11-22 01:42:10 +01:00
|
|
|
end
|
2012-12-04 19:38:58 +01:00
|
|
|
|
2013-06-14 20:54:02 +02:00
|
|
|
end # Forking
|
|
|
|
end # Killer
|
|
|
|
end # Mutant
|