From 6144a78829af70f5fd46f88c5ca2defe7fb5b051 Mon Sep 17 00:00:00 2001 From: Tobias Boege Date: Tue, 7 Apr 2020 14:18:59 +0200 Subject: [PATCH] gb.test: fix Assert.ErrorCode and Teardown spelling [GB.TEST] * BUG: Forward Description in Assert.ErrorCode. * BUG: Fix spelling of TearDown -> Teardown special test method. * OPT: Use Assert.Note() instead of Print in tests. --- comp/src/gb.test/.src/Assert.class | 2 +- comp/src/gb.test/.src/TestMyself/TestSetupTeardown.test | 8 ++++---- comp/src/gb.test/.src/TestSuite/TestSuite.class | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/comp/src/gb.test/.src/Assert.class b/comp/src/gb.test/.src/Assert.class index 3d0f58a44..e4b7b5a76 100644 --- a/comp/src/gb.test/.src/Assert.class +++ b/comp/src/gb.test/.src/Assert.class @@ -376,7 +376,7 @@ Public Sub ErrorCode(Code As Integer, Optional Description As String) As Boolean bRes = Fail(Description) Note(("No error happened")) Else - bRes = Equals(Error.Code, Code) + bRes = Equals(Error.Code, Code, Description) If Not bRes Then Note(Subst$(("Error was: &1 (code: &2) at &3"), Error.Text, Error.Code, Error.Where)) Endif diff --git a/comp/src/gb.test/.src/TestMyself/TestSetupTeardown.test b/comp/src/gb.test/.src/TestMyself/TestSetupTeardown.test index d1534f8b0..74c15fe7c 100644 --- a/comp/src/gb.test/.src/TestMyself/TestSetupTeardown.test +++ b/comp/src/gb.test/.src/TestMyself/TestSetupTeardown.test @@ -6,25 +6,25 @@ Public Const ThisIsAnUnitTestSelfTest As Boolean = True Public Sub Setup() - Print "# Setup TestModule" + Assert.Note("Setup TestModule") End Public Sub Teardown() - Print "# Teardown TestModule" + Assert.Note("Teardown TestModule") End Public Sub SetupEach() - Print "# Setup Each" + Assert.Note("Setup Each") End Public Sub TeardownEach() - Print "# Teardown Each" + Assert.Note("Teardown Each") End diff --git a/comp/src/gb.test/.src/TestSuite/TestSuite.class b/comp/src/gb.test/.src/TestSuite/TestSuite.class index c480e2b14..f388963f0 100644 --- a/comp/src/gb.test/.src/TestSuite/TestSuite.class +++ b/comp/src/gb.test/.src/TestSuite/TestSuite.class @@ -64,8 +64,8 @@ Private Sub StopTestModule(TestModule As Class) Dim Plan As Integer - If TestModule.Symbols.Exist("TearDown") Then - Object.Call(TestModule, "TearDown") + If TestModule.Symbols.Exist("Teardown") Then + Object.Call(TestModule, "Teardown") Endif End