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() {} }