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