Allow deferred expectation of multiple stubs

This commit is contained in:
Michael Miller 2019-11-16 15:24:23 -07:00
parent a8e0f46645
commit a15e2a97b1

View file

@ -31,6 +31,10 @@ module Spectator::Expectations
to_eventually(matcher)
end
def to(stubs : Enumerable(Mocks::MethodStub)) : Nil
stubs.each { |stub| to(stub) }
end
# Asserts that some criteria defined by the matcher is not satisfied.
# This is effectively the opposite of `#to`.
def to_not(matcher) : Nil
@ -44,6 +48,10 @@ module Spectator::Expectations
to_never(matcher)
end
def to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil
stubs.each { |stub| to_not(stub) }
end
# ditto
@[AlwaysInline]
def not_to(matcher) : Nil