Implemented the "createFile(at: with: )" function for the FileService service in the library target.

This commit is contained in:
2025-02-07 21:50:50 +01:00
parent 3dcb110de1
commit 33ae67fc58
5 changed files with 78 additions and 9 deletions
@@ -21,6 +21,10 @@ extension FileServiceSpy: FileServicing {
actions.append(.fileCopied(source, destination))
}
func createFile(at location: URL, with data: Data) async throws (FileServiceError) {
actions.append(.fileCreated(location, data))
}
func createFolder(at location: URL) async throws (FileServiceError) {
actions.append(.folderCreated(location))
}
@@ -42,6 +46,7 @@ extension FileServiceSpy: FileServicing {
extension FileServiceSpy {
enum Action: Equatable {
case fileCreated(_ location: URL, _ data: Data)
case fileCopied(_ source: URL, _ destination: URL)
case folderCreated(_ location: URL)
case itemDeleted(_ location: URL)