From d20959d6a3157f49b40a74a470c20665463c8f63 Mon Sep 17 00:00:00 2001 From: Tim Shadel Date: Fri, 12 Aug 2016 14:33:32 -0600 Subject: [PATCH] Create documents directory --- DVR/Tests/SessionUploadTests.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DVR/Tests/SessionUploadTests.swift b/DVR/Tests/SessionUploadTests.swift index d39110a..136ee6f 100644 --- a/DVR/Tests/SessionUploadTests.swift +++ b/DVR/Tests/SessionUploadTests.swift @@ -104,6 +104,12 @@ class SessionUploadTests: XCTestCase { func writeDataToFile(data: NSData, fileName: String) -> NSURL { let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] let documentsURL = NSURL(fileURLWithPath: documentsPath, isDirectory: true) + + do { + try NSFileManager.defaultManager().createDirectoryAtURL(documentsURL, withIntermediateDirectories: true, attributes: nil) + } catch { + XCTFail("Failed to create documents directory \(documentsURL). Error \(error)") + } let url = documentsURL.URLByAppendingPathComponent(fileName + ".tmp")