mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Flip operands of != in case expected has custom logic
This commit is contained in:
parent
e1a119639f
commit
5dfcad3cb4
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ module Spectator::Matchers
|
|||
# Actually performs the test against the expression.
|
||||
def match(actual : TestExpression(T)) : MatchData forall T
|
||||
before, after = change(actual)
|
||||
if before != expected
|
||||
if expected != before
|
||||
FailedMatchData.new("#{expression.label} was not initially #{expected}",
|
||||
expected: expected.inspect,
|
||||
actual: before.inspect,
|
||||
|
@ -46,7 +46,7 @@ module Spectator::Matchers
|
|||
# A successful match with `#match` should normally fail for this method, and vice-versa.
|
||||
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
||||
before, after = change(actual)
|
||||
if before != expected
|
||||
if expected != before
|
||||
FailedMatchData.new("#{expression.label} was not initially #{expected}",
|
||||
expected: expected.inspect,
|
||||
actual: before.inspect
|
||||
|
|
Loading…
Reference in a new issue