Skip to content

Commit 509c054

Browse files
committed
Delete TestXDG directory after TestNSHTTPCookieStorage
1 parent bb5f05e commit 509c054

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TestFoundation/TestNSHTTPCookieStorage.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ class TestNSHTTPCookieStorage: XCTestCase {
243243
let task = Process()
244244
task.launchPath = bundlePath.substring(to: pathIndex!) + "/xdgTestHelper/xdgTestHelper"
245245
var environment = ProcessInfo.processInfo.environment
246-
environment["XDG_CONFIG_HOME"] = NSHomeDirectory() + "/TestXDG"
246+
let testPath = NSHomeDirectory() + "/TestXDG"
247+
environment["XDG_CONFIG_HOME"] = testPath
247248
task.environment = environment
248249
// Launch the task
249250
task.launch()
@@ -252,5 +253,6 @@ class TestNSHTTPCookieStorage: XCTestCase {
252253
XCTAssertEqual(status, 0)
253254
let terminationReason = task.terminationReason
254255
XCTAssertEqual(terminationReason, Process.TerminationReason.exit)
256+
try? fm.removeItem(atPath: testPath)
255257
}
256258
}

0 commit comments

Comments
 (0)