free_mutant/lib/mutant/killer/static.rb

35 lines
610 B
Ruby
Raw Normal View History

# encoding: utf-8
module Mutant
class Killer
# Abstract base class for killer with static result
class Static < self
# Return result
#
# @return [true]
# if mutation was killed
#
# @return [false]
# otherwise
#
# @api private
#
def run
self.class::RESULT
end
# Killer that is always successful
class Success < self
RESULT = true
2013-06-14 14:54:02 -04:00
end # Success
# Killer that always fails
class Fail < self
RESULT = false
2013-06-14 14:54:02 -04:00
end # Fail
end # Static
end # Killer
end # Mutant