mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Update Ameba and address issues
This commit is contained in:
parent
aa03e3527d
commit
5da21f8ede
3 changed files with 5 additions and 4 deletions
|
@ -13,4 +13,4 @@ license: MIT
|
|||
development_dependencies:
|
||||
ameba:
|
||||
github: crystal-ameba/ameba
|
||||
version: ~> 0.13.1
|
||||
version: ~> 0.14.3
|
||||
|
|
|
@ -110,9 +110,9 @@ module Spectator::Matchers
|
|||
end
|
||||
end.reject do |(_, count)|
|
||||
count <= 0
|
||||
end.map do |(element, count)|
|
||||
end.flat_map do |(element, count)|
|
||||
Array.new(count, element)
|
||||
end.flatten
|
||||
end
|
||||
end
|
||||
|
||||
private def unexpected(value, label)
|
||||
|
|
|
@ -27,7 +27,8 @@ module Spectator::Matchers
|
|||
# A successful match with `#match` should normally fail for this method, and vice-versa.
|
||||
def negated_match(actual : Expression(T)) : MatchData forall T
|
||||
snapshot = snapshot_values(actual.value)
|
||||
if snapshot.values.any?
|
||||
# Intentionally check truthiness of each value.
|
||||
if snapshot.values.any? # ameba:disable Performance/AnyInsteadOfEmpty
|
||||
FailedMatchData.new(description, "#{actual.label} responds to #{label}", values(snapshot).to_a)
|
||||
else
|
||||
SuccessfulMatchData.new(description)
|
||||
|
|
Loading…
Reference in a new issue