mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Revert "Coerce operations in match? to booleans"
This reverts commit 76c21d447a
.
Should no longer be needed since mocks and doubles should indirectly leak into StandardMatcher types.
This commit is contained in:
parent
d9d30c57d0
commit
a8e0f46645
19 changed files with 22 additions and 22 deletions
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(expected.value === actual.value)
|
||||
expected.value === actual.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -14,7 +14,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!expected.value.includes?(actual.value)
|
||||
expected.value.includes?(actual.value)
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!expected.value.all? do |item|
|
||||
expected.value.all? do |item|
|
||||
actual.value.includes?(item)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!actual.value.empty?
|
||||
actual.value.empty?
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(expected.value == actual.value)
|
||||
expected.value == actual.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(actual.value >= expected.value)
|
||||
actual.value >= expected.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(actual.value > expected.value)
|
||||
actual.value > expected.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!actual.value.has_key?(expected.value)
|
||||
actual.value.has_key?(expected.value)
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -23,17 +23,17 @@ module Spectator::Matchers
|
|||
|
||||
# Checks if a `String` matches the expected values.
|
||||
# The `includes?` method is used for this check.
|
||||
private def match_string?(value) : Bool
|
||||
!!expected.value.all? do |item|
|
||||
private def match_string?(value)
|
||||
expected.value.all? do |item|
|
||||
value.includes?(item)
|
||||
end
|
||||
end
|
||||
|
||||
# Checks if an `Enumerable` matches the expected values.
|
||||
# The `===` operator is used on every item.
|
||||
private def match_enumerable?(value) : Bool
|
||||
private def match_enumerable?(value)
|
||||
array = value.to_a
|
||||
!!expected.value.all? do |item|
|
||||
expected.value.all? do |item|
|
||||
array.any? do |element|
|
||||
item === element
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!actual.value.has_value?(expected.value)
|
||||
actual.value.has_value?(expected.value)
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(expected.value != actual.value)
|
||||
expected.value != actual.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(actual.value <= expected.value)
|
||||
actual.value <= expected.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(actual.value < expected.value)
|
||||
actual.value < expected.value
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!actual.value.nil?
|
||||
actual.value.nil?
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -27,7 +27,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!expected.value.includes?(actual.value)
|
||||
expected.value.includes?(actual.value)
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!expected.value.same?(actual.value)
|
||||
expected.value.same?(actual.value)
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(expected.value == actual.value.size)
|
||||
expected.value == actual.value.size
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!(expected.value.size == actual.value.size)
|
||||
expected.value.size == actual.value.size
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
|
@ -13,7 +13,7 @@ module Spectator::Matchers
|
|||
|
||||
# Checks whether the matcher is satisifed with the expression given to it.
|
||||
private def match?(actual : TestExpression(T)) : Bool forall T
|
||||
!!actual.value.is_a?(Expected)
|
||||
actual.value.is_a?(Expected)
|
||||
end
|
||||
|
||||
# Message displayed when the matcher isn't satisifed.
|
||||
|
|
Loading…
Reference in a new issue