From 53f7c94e8ab6f08befb46ab71e49a327bf35f7ad Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Mon, 11 Oct 2021 22:39:16 -0600 Subject: [PATCH] Add missing negation variants for method stubs --- src/spectator/expectation.cr | 8 ++++++++ 1 file changed, 8 insertions(+) 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.