mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Initial work on deferred have_received check
This commit is contained in:
parent
98bfed2f83
commit
2dc86c05ac
1 changed files with 8 additions and 2 deletions
|
@ -24,8 +24,14 @@ module Spectator::Expectations
|
||||||
report(match_data)
|
report(match_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to(stub : Mocks::MethodStub) : Nil
|
def to(stub : Mocks::GenericMethodStub(RT, T, NT)) : Nil forall RT, T, NT
|
||||||
raise NotImplementedError.new("`expect(double).to receive(message)` syntax not implemented yet")
|
value = TestValue.new(stub.name, stub.to_s)
|
||||||
|
matcher = if stub.arguments?
|
||||||
|
Matchers::ReceiveArgumentsMatcher.new(value, stub.arguments)
|
||||||
|
else
|
||||||
|
Matchers::ReceiveMatcher.new(value)
|
||||||
|
end
|
||||||
|
to_eventually(matcher)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Asserts that some criteria defined by the matcher is not satisfied.
|
# Asserts that some criteria defined by the matcher is not satisfied.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue