Skip to content

Commit c1c78f8

Browse files
author
Thomas Taschauer
committed
fix test action
1 parent 495b06d commit c1c78f8

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

OpenDocumentReaderTests/OpenDocumentReaderTests.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,16 @@ class OpenDocumentReaderTests: XCTestCase {
2929
return
3030
}
3131

32+
var fileURL: URL?
33+
3234
let downloadTask = URLSession.shared.downloadTask(with: url!) {
3335
urlOrNil, responseOrNil, errorOrNil in
34-
// check for and handle errors:
35-
// * errorOrNil should be nil
36-
// * responseOrNil should be an HTTPURLResponse with statusCode in 200..<299
3736

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-
}
37+
fileURL = urlOrNil
4438
}
4539
downloadTask.resume()
40+
41+
try FileManager.default.moveItem(at: fileURL!, to: self.saveURL!)
4642
}
4743

4844
func testExample() throws {

0 commit comments

Comments
 (0)