free_mutant/lib/mutant/matcher/null.rb

25 lines
450 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 Equalizer.new
# 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