Last active
February 23, 2019 09:44
-
-
Save polac24/59fbd3a4a00eed3afc661c7e030d8d72 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 testListenerIsKeeptWithWeakReference() { | |
// Arrange | |
let sut = MasterClass() | |
weak var weakListener: MasterClassListener? | |
do { | |
let listener = MasterListener() | |
weakListener = listener | |
// Act | |
sut.add(listener) | |
} | |
// Assert | |
XCTAssertNil(weakListener) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment