From 8ce89c76b94eb709c506468eb6798ffdde285a68 Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Fri, 13 Dec 2024 15:30:21 -0800 Subject: [PATCH] Fix build issue on older versions of swift --- .../Matchers/BeIdenticalToObjectTest.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Tests/NimbleTests/Matchers/BeIdenticalToObjectTest.swift b/Tests/NimbleTests/Matchers/BeIdenticalToObjectTest.swift index 28f3b0fcd..4091d0119 100644 --- a/Tests/NimbleTests/Matchers/BeIdenticalToObjectTest.swift +++ b/Tests/NimbleTests/Matchers/BeIdenticalToObjectTest.swift @@ -21,15 +21,10 @@ final class BeIdenticalToObjectTest: XCTestCase { } func testBeIdenticalToAnyObjectProtocol() { - protocol SomeObject: AnyObject {} - class ConcreteImpl: SomeObject { - init() {} - } - - let object = ConcreteImpl() + let object = AnObjectImplementation() - expect(object as SomeObject).to(be(object)) - expect(object as SomeObject).to(beIdenticalTo(object)) + expect(object as AnObjectProtocol).to(be(object)) + expect(object as AnObjectProtocol).to(beIdenticalTo(object)) } func testBeIdenticalToNegative() { @@ -70,5 +65,9 @@ final class BeIdenticalToObjectTest: XCTestCase { expect(self.testObjectA) === testObjectA expect(self.testObjectA) !== testObjectB } +} +private protocol AnObjectProtocol: AnyObject {} +private final class AnObjectImplementation: AnObjectProtocol { + init() {} }