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