mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Don't splat values for failed match data
This caused an issue where keys with the same name as existing arguments couldn't be used. In this case, "description" and "failure_message". Fixes https://github.com/icy-arctic-fox/spectator/issues/13
This commit is contained in:
parent
db284066f6
commit
a4680f2584
4 changed files with 8 additions and 8 deletions
|
@ -30,7 +30,7 @@ module Spectator::Matchers
|
|||
if match?(snapshot)
|
||||
SuccessfulMatchData.new(description)
|
||||
else
|
||||
FailedMatchData.new(description, "#{actual.label} does not have attributes #{expected.label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} does not have attributes #{expected.label}", values(snapshot).to_a)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -39,7 +39,7 @@ module Spectator::Matchers
|
|||
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
||||
snapshot = snapshot_values(actual.value)
|
||||
if match?(snapshot)
|
||||
FailedMatchData.new(description, "#{actual.label} has attributes #{expected.label}", **negated_values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} has attributes #{expected.label}", negated_values(snapshot).to_a)
|
||||
else
|
||||
SuccessfulMatchData.new(description)
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ module Spectator::Matchers
|
|||
if match?(snapshot)
|
||||
SuccessfulMatchData.new(description)
|
||||
else
|
||||
FailedMatchData.new(description, "#{actual.label} does not have #{expected.label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} does not have #{expected.label}", values(snapshot).to_a)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -29,7 +29,7 @@ module Spectator::Matchers
|
|||
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
||||
snapshot = snapshot_values(actual.value)
|
||||
if match?(snapshot)
|
||||
FailedMatchData.new(description, "#{actual.label} has #{expected.label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} has #{expected.label}", values(snapshot).to_a)
|
||||
else
|
||||
SuccessfulMatchData.new(description)
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ module Spectator::Matchers
|
|||
if match?(snapshot)
|
||||
SuccessfulMatchData.new(description)
|
||||
else
|
||||
FailedMatchData.new(description, "#{actual.label} is not #{expected.label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} is not #{expected.label}", values(snapshot).to_a)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -35,7 +35,7 @@ module Spectator::Matchers
|
|||
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
||||
snapshot = snapshot_values(actual.value)
|
||||
if match?(snapshot)
|
||||
FailedMatchData.new(description, "#{actual.label} is #{expected.label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} is #{expected.label}", values(snapshot).to_a)
|
||||
else
|
||||
SuccessfulMatchData.new(description)
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ module Spectator::Matchers
|
|||
if snapshot.values.all?
|
||||
SuccessfulMatchData.new(description)
|
||||
else
|
||||
FailedMatchData.new(description, "#{actual.label} does not respond to #{label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} does not respond to #{label}", values(snapshot).to_a)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -28,7 +28,7 @@ module Spectator::Matchers
|
|||
def negated_match(actual : TestExpression(T)) : MatchData forall T
|
||||
snapshot = snapshot_values(actual.value)
|
||||
if snapshot.values.any?
|
||||
FailedMatchData.new(description, "#{actual.label} responds to #{label}", **values(snapshot))
|
||||
FailedMatchData.new(description, "#{actual.label} responds to #{label}", values(snapshot).to_a)
|
||||
else
|
||||
SuccessfulMatchData.new(description)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue