From 68cc88653b94679d05c1c5c658f7295d70a04464 Mon Sep 17 00:00:00 2001 From: Vitosh Academy Date: Thu, 18 Aug 2016 15:25:19 +0200 Subject: [PATCH] Update SpecSuite.cls The idea is to have a line, telling us how many times have we tried to add tests to the tool. In some cases, it may execute only the tests it can and thus the final line should look with this: = PASS (48 of 48 passed) = 18.08.2016 15:24:53 ========================= Total tests:49 Then we realize that something was worng. --- src/SpecSuite.cls | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SpecSuite.cls b/src/SpecSuite.cls index fb580a1..2ce0543 100644 --- a/src/SpecSuite.cls +++ b/src/SpecSuite.cls @@ -29,6 +29,7 @@ Public Description As String Public BeforeEachCallback As String Public BeforeEachCallbackArgs As Variant +Private pCounter As Long Public Property Get SpecsCol() As Collection If pSpecsCol Is Nothing Then: Set pSpecsCol = New Collection @@ -54,6 +55,8 @@ End Property Public Function It(Description As String, Optional SpecId As String = "") As SpecDefinition Dim Spec As New SpecDefinition + pCounter = pCounter + 1 + ' Call BeforeEach if defined ExecuteBeforeEach @@ -64,6 +67,10 @@ Public Function It(Description As String, Optional SpecId As String = "") As Spe Set It = Spec End Function +Public Sub TotalTests() + Debug.Print "Total tests:" & pCounter +End Sub + '' ' Setup a callback to run before each spec '