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

View file

@ -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