We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 495b06d commit c1c78f8Copy full SHA for c1c78f8
1 file changed
OpenDocumentReaderTests/OpenDocumentReaderTests.swift
@@ -29,20 +29,16 @@ class OpenDocumentReaderTests: XCTestCase {
29
return
30
}
31
32
+ var fileURL: URL?
33
+
34
let downloadTask = URLSession.shared.downloadTask(with: url!) {
35
urlOrNil, responseOrNil, errorOrNil in
- // check for and handle errors:
- // * errorOrNil should be nil
36
- // * responseOrNil should be an HTTPURLResponse with statusCode in 200..<299
37
38
- guard let fileURL = urlOrNil else { return }
39
- do {
40
- try FileManager.default.moveItem(at: fileURL, to: self.saveURL!)
41
- } catch {
42
- print ("file error: \(error)")
43
- }
+ fileURL = urlOrNil
44
45
downloadTask.resume()
+ try FileManager.default.moveItem(at: fileURL!, to: self.saveURL!)
46
47
48
func testExample() throws {
0 commit comments