free_mutant/lib/mutant/strategy.rb

43 lines
668 B
Ruby
Raw Normal View History

2012-11-21 18:10:50 -05:00
module Mutant
class Strategy
2012-11-26 05:30:00 -05:00
include AbstractType
2012-11-21 18:10:50 -05:00
# Kill mutation
#
# @param [Mutation]
#
# @return [Killer]
#
# @api private
#
def self.kill(mutation)
killer.new(self, mutation)
end
# Return killer
#
# @return [Class:Killer]
#
# @api private
#
2012-11-21 18:10:50 -05:00
def self.killer
self::KILLER
2012-11-21 18:10:50 -05:00
end
# Static strategies
class Static < self
# Always fail to kill strategy
class Fail < self
KILLER = Killer::Static::Fail
end
# Always succeed to kill strategy
class Success < self
KILLER = Killer::Static::Success
end
2012-11-21 18:10:50 -05:00
end
end
end