mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Treat to(mock) and to_eventually(mock) as the same
Fixes https://gitlab.com/arctic-fox/spectator/-/issues/48
This commit is contained in:
parent
f329e2cbd5
commit
84476b0357
1 changed files with 16 additions and 0 deletions
|
@ -64,12 +64,28 @@ module Spectator::Expectations
|
||||||
Harness.current.defer { to(matcher) }
|
Harness.current.defer { to(matcher) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_eventually(stub : Mocks::MethodStub) : Nil
|
||||||
|
to(stub)
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_eventually(stubs : Enumerable(Mocks::MethodStub)) : Nil
|
||||||
|
to(stub)
|
||||||
|
end
|
||||||
|
|
||||||
# Asserts that some criteria defined by the matcher is never satisfied.
|
# Asserts that some criteria defined by the matcher is never satisfied.
|
||||||
# The expectation is checked after the example finishes and all hooks have run.
|
# The expectation is checked after the example finishes and all hooks have run.
|
||||||
def to_never(matcher) : Nil
|
def to_never(matcher) : Nil
|
||||||
Harness.current.defer { to_not(matcher) }
|
Harness.current.defer { to_not(matcher) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_never(stub : Mocks::MethodStub) : Nil
|
||||||
|
to_not(stub)
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_never(stub : Enumerable(Mocks::MethodStub)) : Nil
|
||||||
|
to_not(stub)
|
||||||
|
end
|
||||||
|
|
||||||
# ditto
|
# ditto
|
||||||
@[AlwaysInline]
|
@[AlwaysInline]
|
||||||
def never_to(matcher) : Nil
|
def never_to(matcher) : Nil
|
||||||
|
|
Loading…
Reference in a new issue