mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Negated all match is not supported
This commit is contained in:
parent
0cb77b3355
commit
46c775932a
1 changed files with 11 additions and 3 deletions
|
@ -29,10 +29,18 @@ module Spectator::Matchers
|
||||||
found ? found : SuccessfulMatchData.new
|
found ? found : SuccessfulMatchData.new
|
||||||
end
|
end
|
||||||
|
|
||||||
# Performs the test against the expression, but inverted.
|
# Negated matching for this matcher is not supported.
|
||||||
# A successful match with `#match` should normally fail for this method, and vice-versa.
|
# Attempting to call this method will result in a compilation error.
|
||||||
|
#
|
||||||
|
# This syntax has a logical problem.
|
||||||
|
# "All values do not satisfy some condition."
|
||||||
|
# Does this mean that all values don't satisfy the matcher?
|
||||||
|
# What if only one doesn't?
|
||||||
|
# What if the collection is empty?
|
||||||
|
#
|
||||||
|
# RSpec doesn't support this syntax either.
|
||||||
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
||||||
raise NotImplementedError.new("AllMatcher#negated_match")
|
{% raise "The `expect { }.to_not all()` syntax is not supported (ambiguous)." %}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Maps all values in the test collection to their own test values.
|
# Maps all values in the test collection to their own test values.
|
||||||
|
|
Loading…
Reference in a new issue