We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd7e89d commit 6b6d78aCopy full SHA for 6b6d78a
Tests/TestingTests/AttachmentTests.swift
@@ -83,6 +83,13 @@ struct AttachmentTests {
83
let attachableValue = MyAttachable(string: "<!doctype html>")
84
let attachment = Test.Attachment(attachableValue, named: "loremipsum.tar.gz.gif.jpeg.html")
85
86
+ // Write the attachment to disk once to ensure the original filename is not
87
+ // available and we add a suffix.
88
+ let originalFilePath = try attachment.write(toFileInDirectoryAtPath: temporaryDirectory())
89
+ defer {
90
+ remove(originalFilePath)
91
+ }
92
+
93
// Write the attachment to disk, then read it back.
94
let suffix = String(UInt64.random(in: 0 ..< .max), radix: 36)
95
let filePath = try attachment.write(toFileInDirectoryAtPath: temporaryDirectory(), appending: suffix)
0 commit comments