Last active
February 24, 2019 19:14
-
-
Save polac24/169e919ec4376785d2c74d394baf6241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testListenerKeptWeakReferenceUsingTeardown() { | |
// Arrange | |
let sut = MasterClass() | |
let listener = MasterListener() | |
// Act | |
sut.add(listener) | |
// Assert | |
addTeardownBlock { [weak listener] in | |
XCTAssertNil(listener) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment