From 2a281393a758d532a4d7d3ce24ae9c152b757e09 Mon Sep 17 00:00:00 2001 From: Antonio J Pallares Date: Mon, 14 Mar 2022 08:24:05 +0100 Subject: [PATCH] test: fix existing unit tests of OCMock where now, by default, `objcVerify`'s quantifier is `.exactly(1)` instead of `.atLeast(1)` --- Tests/OCMock/ObjectiveClassTest.swift | 2 +- Tests/OCMock/ObjectiveProtocolTest.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/OCMock/ObjectiveClassTest.swift b/Tests/OCMock/ObjectiveClassTest.swift index 921219c7..96657b0c 100644 --- a/Tests/OCMock/ObjectiveClassTest.swift +++ b/Tests/OCMock/ObjectiveClassTest.swift @@ -152,7 +152,7 @@ final class ObjectiveClassTest: XCTestCase { XCTAssertFalse(mock.dudka(lelo: "heya")) XCTAssertTrue(mock.dudka(lelo: "heyda")) - objcVerify(mock.dudka(lelo: objcAny())) + objcVerify(mock.dudka(lelo: objcAny()), .atLeast(1)) } func testVerifyAtLeast() { diff --git a/Tests/OCMock/ObjectiveProtocolTest.swift b/Tests/OCMock/ObjectiveProtocolTest.swift index b110e9ab..4f1558e4 100644 --- a/Tests/OCMock/ObjectiveProtocolTest.swift +++ b/Tests/OCMock/ObjectiveProtocolTest.swift @@ -29,9 +29,9 @@ final class ObjectiveProtocolTest: XCTestCase { objcVerify(mock.tableView!(objcAny(), canFocusRowAt: IndexPath(row: 0, section: 22))) objcVerify(mock.tableView!(tableView, canFocusRowAt: IndexPath(row: 0, section: 22))) - objcVerify(mock.tableView!(objcAny(), canFocusRowAt: IndexPath(row: 1, section: 22))) + objcVerify(mock.tableView!(objcAny(), canFocusRowAt: IndexPath(row: 1, section: 22)), .atLeast(1)) objcVerify(mock.tableView!(tableView, canFocusRowAt: IndexPath(row: 1, section: 22))) - objcVerify(mock.tableView!(objcAny(), canFocusRowAt: IndexPath(row: 1, section: 22))) + objcVerify(mock.tableView!(objcAny(), canFocusRowAt: IndexPath(row: 1, section: 22)), .atLeast(1)) objcVerify(mock.tableView!(tableView, canFocusRowAt: IndexPath(row: 1, section: 22))) } @@ -65,7 +65,7 @@ final class ObjectiveProtocolTest: XCTestCase { objcVerify(mock.textField!(objcAny(), shouldChangeCharactersIn: range, replacementString: "Hello from the other side, ObjC!")) objcVerify(mock.textField!(objcAny(), shouldChangeCharactersIn: range, replacementString: "TadeasKriz is a HaXoR.")) - objcVerify(mock.textField!(objcAny(), shouldChangeCharactersIn: range, replacementString: objcAny())) + objcVerify(mock.textField!(objcAny(), shouldChangeCharactersIn: range, replacementString: objcAny()), .atLeast(1)) } // NOTE: This is an example of a wrong way to test an optional method.