From c61767f501385b2891e769cdb8da52e2e57ec32c Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 22 Jan 2017 22:02:45 -0500 Subject: [PATCH] Don't remove the temporary unarchive directory in unit tests This should fix a potential bug where the unit tests try to unarchive a file that does not exist. --- Tests/SUUnarchiverTest.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/SUUnarchiverTest.swift b/Tests/SUUnarchiverTest.swift index dcd6028a..3ce04f5b 100644 --- a/Tests/SUUnarchiverTest.swift +++ b/Tests/SUUnarchiverTest.swift @@ -16,10 +16,10 @@ class SUUnarchiverTest: XCTestCase let fileManager = FileManager.default + // Do not remove this temporary directory + // If we do want to clean up and remove it (which isn't necessary but nice), we'd have to remove it + // after *both* our unarchive success and failure calls below finish (they both have async completion blocks inside their implementation) let tempDirectoryURL = try! fileManager.url(for: .itemReplacementDirectory, in: .userDomainMask, appropriateFor: URL(fileURLWithPath: NSHomeDirectory()), create: true) - defer { - try! fileManager.removeItem(at: tempDirectoryURL) - } let unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))") let unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")