Add missing negation variants for method stubs

This commit is contained in:
Michael Miller 2021-10-11 22:39:16 -06:00
parent 9d4a5886e5
commit 53f7c94e8a
No known key found for this signature in database
GPG key ID: F9A0C5C65B162436

View file

@ -137,10 +137,18 @@ module Spectator
to_never(matcher) to_never(matcher)
end end
def not_to(stub : Mocks::MethodStub) : Nil
to_not(stub)
end
def to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil def to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil
stubs.each { |stub| to_not(stub) } stubs.each { |stub| to_not(stub) }
end end
def not_to(stubs : Enumerable(Mocks::MethodStub)) : Nil
to_not(stubs)
end
# Asserts that some criteria defined by the matcher is eventually satisfied. # Asserts that some criteria defined by the matcher is eventually 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.
# Allows a custom message to be used. # Allows a custom message to be used.