free_mutant/lib/mutant/matcher/null.rb
2014-07-06 14:31:12 +00:00

24 lines
448 B
Ruby

module Mutant
class Matcher
# A null matcher, that does not match any subjects
class Null < self
include Concord.new
# Enumerate subjects
#
# @return [Enumerator<Subject]
# if no block given
#
# @return [self]
# otherwise
#
# @api private
#
def each
return to_enum unless block_given?
self
end
end # Null
end # Matcher
end # Mutant