free_mutant/lib/mutant/matcher/null.rb

25 lines
448 B
Ruby
Raw Normal View History

2014-02-13 10:47:29 -05:00
module Mutant
class Matcher
# A null matcher, that does not match any subjects
class Null < self
include Concord.new
2014-02-13 10:47:29 -05:00
# Enumerate subjects
#
# @return [Enumerator<Subject]
# if no block given
#
# @return [self]
# otherwise
#
# @api private
#
2014-05-27 11:12:36 -04:00
def each
2014-02-13 10:47:29 -05:00
return to_enum unless block_given?
self
end
end # Null
end # Matcher
end # Mutant