free_mutant/lib/mutant/strategy.rb
Markus Schirp 7be00708b6 Improve rspec dm2 strategy
* Expand foo? to foo_predicate_spec.rb
* Expand foo! to foo_bang_spec.rb
* Execute all public method specs on mutation of private method
* Warn on stderr when no spec file was found (better than nothing to be
  iproved later)
2012-12-07 16:57:42 +01:00

42 lines
668 B
Ruby

module Mutant
class Strategy
include AbstractType
# Kill mutation
#
# @param [Mutation]
#
# @return [Killer]
#
# @api private
#
def self.kill(mutation)
killer.new(self, mutation)
end
# Return killer
#
# @return [Class:Killer]
#
# @api private
#
def self.killer
self::KILLER
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
end
end
end