free_mutant/lib/mutant/mutation/neutral.rb

47 lines
790 B
Ruby
Raw Normal View History

# encoding: utf-8
2013-01-15 17:46:05 -05:00
module Mutant
class Mutation
# Neutral mutation
class Neutral < self
SYMBOL = 'neutral'
# Noop mutation, special case of neutral
class Noop < self
SYMBOL = 'noop'
end
2013-01-15 17:46:05 -05:00
# Return identification
#
# @return [String]
#
# @api private
#
def identification
"#{self.class::SYMBOL}:#{super}"
2013-01-15 17:46:05 -05:00
end
memoize :identification
# Test if killer is successful
#
# @param [Killer] killer
#
# @return [true]
# if killer did NOT killed mutation
#
# @return [false]
# otherwise
#
# @api private
#
def success?(killer)
!killer.killed?
end
2013-06-14 14:54:02 -04:00
end # Neutral
end # Mutation
end # Mutant