Fix negation of values in Expectation

This commit is contained in:
Michael Miller 2019-03-22 10:57:53 -06:00
parent 33841e8888
commit 92b407380b

View file

@ -21,9 +21,10 @@ module Spectator::Expectations
# Information about the match. # Information about the match.
# Returned value and type will something that has key-value pairs (like a `NamedTuple`). # Returned value and type will something that has key-value pairs (like a `NamedTuple`).
def values def values
@match_data.values.tap do |values| @match_data.values.tap do |labeled_values|
if @negated if @negated
values.each_value do |value| labeled_values.each do |labeled_value|
value = labeled_value.value
value.negate if value.responds_to?(:negate) value.negate if value.responds_to?(:negate)
end end
end end