mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Pretify stub and call output
Fix some tests.
This commit is contained in:
parent
36cc035417
commit
d7ea969f55
3 changed files with 29 additions and 15 deletions
|
@ -71,13 +71,16 @@ module Spectator::Matchers
|
|||
private def values(actual : Expression(T)) forall T
|
||||
{
|
||||
expected: @stub.to_s,
|
||||
actual: actual.value._spectator_calls.inspect,
|
||||
actual: actual.value._spectator_calls.join("\n"),
|
||||
}
|
||||
end
|
||||
|
||||
# Additional information about the match failure when negated.
|
||||
private def negated_values(actual : Expression(T)) forall T
|
||||
values(actual)
|
||||
{
|
||||
expected: "Not #{@stub}",
|
||||
actual: actual.value._spectator_calls.join("\n"),
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,5 +29,10 @@ module Spectator
|
|||
|
||||
constraint === call.arguments
|
||||
end
|
||||
|
||||
# String representation of the stub, formatted as a method call.
|
||||
def to_s(io : IO) : Nil
|
||||
io << "#" << method << (constraint || "(any args)")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue