mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix negated contain case
This commit is contained in:
parent
a2ef0fa46a
commit
edf8ae36df
1 changed files with 2 additions and 2 deletions
|
@ -46,11 +46,11 @@ module Spectator::Matchers
|
||||||
actual_value = actual.value
|
actual_value = actual.value
|
||||||
return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:includes?)
|
return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:includes?)
|
||||||
|
|
||||||
missing = expected.value.reject do |item|
|
satisfied = expected.value.any? do |item|
|
||||||
actual_value.includes?(item)
|
actual_value.includes?(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
if missing.empty?
|
if satisfied
|
||||||
# Contents are present.
|
# Contents are present.
|
||||||
FailedMatchData.new(description, "#{actual.label} contains #{expected.label}",
|
FailedMatchData.new(description, "#{actual.label} contains #{expected.label}",
|
||||||
expected: "Not #{expected.value.inspect}",
|
expected: "Not #{expected.value.inspect}",
|
||||||
|
|
Loading…
Reference in a new issue