Improved the naming of the functions for the FileServicing protocol in the library target.

This commit is contained in:
2025-01-13 23:27:50 +01:00
parent df556f83ab
commit 26fde119ef
6 changed files with 69 additions and 69 deletions
@@ -13,21 +13,24 @@ final class FileServiceSpy {
// MARK: - FileServicing
extension FileServiceSpy: FileServicing {
var currentFolder: URL {
get async { .someCurrentFolder }
}
func createFolder(at url: URL) async throws (FileServiceError) {
actions.append(.folderCreated(url))
}
func delete(at url: URL) async throws (FileServiceError) {
actions.append(.itemDeleted(url))
func createFolder(at location: URL) async throws (FileServiceError) {
actions.append(.folderCreated(location))
}
func deleteItem(at location: URL) async throws (FileServiceError) {
actions.append(.itemDeleted(location))
}
@discardableResult
func exists(at url: URL) async throws (FileServiceError) -> Bool {
actions.append(.itemExists(url))
func isItemExists(at location: URL) async throws (FileServiceError) -> Bool {
actions.append(.itemExists(location))
return .random()
}
@@ -38,8 +41,8 @@ extension FileServiceSpy: FileServicing {
extension FileServiceSpy {
enum Action: Equatable {
case folderCreated(_ url: URL)
case itemDeleted(_ url: URL)
case itemExists(_ url: URL)
case folderCreated(_ location: URL)
case itemDeleted(_ location: URL)
case itemExists(_ location: URL)
}
}