Fix negative match case for contain/cover matcher

This commit is contained in:
Michael Miller 2020-01-05 23:01:25 -07:00
parent b7c686e836
commit 5673144527

View file

@ -18,6 +18,13 @@ module Spectator::Matchers
end
end
# If the expectation is negated, then this method is called instead of `#match?`.
private def does_not_match?(actual : TestExpression(T)) : Bool forall T
!expected.value.any? do |item|
actual.value.includes?(item)
end
end
# Message displayed when the matcher isn't satisifed.
#
# This is only called when `#match?` returns false.