Implemented the "createFile(at: with: )" function for the FileService service in the library target.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user