From 36071fcdbfa17036bfdd3e29edaedcfbee58bdff Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 19 Oct 2018 18:20:42 -0600 Subject: [PATCH] Sanity check on expectations --- spec/expectations_helper.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/expectations_helper.cr b/spec/expectations_helper.cr index 0cbe626..6a12c4c 100644 --- a/spec/expectations_helper.cr +++ b/spec/expectations_helper.cr @@ -23,11 +23,15 @@ def new_expectation(expected : ExpectedType = 123, actual : ActualType = 123) fo end def new_met_expectation(value : T = 123) forall T - new_expectation(value, value) + new_expectation(value, value).tap do |expectation| + expectation.satisfied?.should be_true # Sanity check. + end end def new_unmet_expectation(expected : ExpectedType = 123, actual : ActualType = 456) forall ExpectedType, ActualType - new_expectation(expected, actual) + new_expectation(expected, actual).tap do |expectation| + expectation.satisfied?.should be_false # Sanity check. + end end def new_successful_result