From 54d8d418488cae0d72bfdda8e509304862c6166b Mon Sep 17 00:00:00 2001 From: JP Wright Date: Tue, 12 Jun 2018 18:54:43 +0200 Subject: [PATCH] Update file path creation to use FileManager in tests --- Tests/DVRTests/SessionUploadTests.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/DVRTests/SessionUploadTests.swift b/Tests/DVRTests/SessionUploadTests.swift index bd29045..46ce450 100644 --- a/Tests/DVRTests/SessionUploadTests.swift +++ b/Tests/DVRTests/SessionUploadTests.swift @@ -86,8 +86,7 @@ class SessionUploadTests: XCTestCase { } private func writeDataToFile(_ data: Data, fileName: String) -> URL { - let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] - let documentsURL = URL(fileURLWithPath: documentsPath, isDirectory: true) + let documentsURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) let url = documentsURL.appendingPathComponent(fileName + ".tmp") try? data.write(to: url, options: [.atomic])