Treat to(mock) and to_eventually(mock) as the same

Fixes https://gitlab.com/arctic-fox/spectator/-/issues/48
This commit is contained in:
Michael Miller 2020-04-23 22:43:37 -06:00
parent f329e2cbd5
commit 84476b0357
1 changed files with 16 additions and 0 deletions

View File

@ -64,12 +64,28 @@ module Spectator::Expectations
Harness.current.defer { to(matcher) }
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.
# The expectation is checked after the example finishes and all hooks have run.
def to_never(matcher) : Nil
Harness.current.defer { to_not(matcher) }
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
@[AlwaysInline]
def never_to(matcher) : Nil