diff --git a/src/spectator/expectation.cr b/src/spectator/expectation.cr index ff9dc57..cacde95 100644 --- a/src/spectator/expectation.cr +++ b/src/spectator/expectation.cr @@ -137,10 +137,18 @@ module Spectator to_never(matcher) end + def not_to(stub : Mocks::MethodStub) : Nil + to_not(stub) + end + def to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil stubs.each { |stub| to_not(stub) } end + def not_to(stubs : Enumerable(Mocks::MethodStub)) : Nil + to_not(stubs) + end + # Asserts that some criteria defined by the matcher is eventually satisfied. # The expectation is checked after the example finishes and all hooks have run. # Allows a custom message to be used.