Skip to content

Commit

Permalink
Update file path creation to use FileManager in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
loudmouth committed Jun 12, 2018
1 parent 2ff5967 commit 54d8d41
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Tests/DVRTests/SessionUploadTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 54d8d41

Please sign in to comment.