You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tests/JSONLoggerTests/PipeHelper.swift
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -8,24 +8,28 @@ typealias Pipe = FakePipe
8
8
finalclassFakePipe{
9
9
10
10
init(){
11
-
try!Data().write(to: fileURL)
12
-
assert(FileManager.default.fileExists(atPath: fileURL.absoluteURL.path),"Created file does not exist!")
11
+
/* For some reasons, creating the file with `FakePipe.fm.createFile(atPath: filepath, contents: nil)` fails.
12
+
* Instead we use the Data.write(to:) method which works. */
13
+
guard(try?Data().write(to: fileURL))!=nilelse{
14
+
fatalError("\u{1B}[91;1mCould not create temporary file.\u{1B}[0m\n\u{1B}[31;1mPlease make sure to run the test with the `--dir \"\(fileURL.deletingLastPathComponent().path)\"` option.\u{1B}[0m")
0 commit comments