Implemented the RenderFilesTask task in the library target.

This commit is contained in:
2025-02-08 12:55:31 +01:00
parent 5f5f902773
commit 94e6070091
4 changed files with 44 additions and 13 deletions
@@ -59,6 +59,5 @@ private extension TemplateTests {
.testCasesPublic,
.root,
]
}
}
@@ -4,17 +4,15 @@ import Testing
@testable import ColibriLibrary
struct InitGitInFolderTaskTests {
// MARK: Properties
private let spy = TerminalServiceSpy()
// MARK:
// MARK: Functions tests
@Test(arguments: [URL.someCurrentFolder, .someNewFolder, .someDotFolder, .someTildeFolder])
func task(at rootFolder: URL) async throws {
// GIVEN
let initGitInFolder = InitGitInFolderTask(terminalService: spy)
let terminalService = TerminalServiceSpy()
let initGitInFolder = InitGitInFolderTask(terminalService: terminalService)
// WHEN
try await initGitInFolder(at: rootFolder)
@@ -23,10 +21,10 @@ struct InitGitInFolderTaskTests {
let executableURL = URL(at: "/usr/bin/git")
let pathFolder = rootFolder.pathString
#expect(spy.actions.count == 3)
#expect(spy.actions[0] == .ran(executableURL, ["init", pathFolder]))
#expect(spy.actions[1] == .ran(executableURL, ["-C", pathFolder, "add", "."]))
#expect(spy.actions[2] == .ran(executableURL, ["-C", pathFolder, "commit", "-m", "Initial commit"]))
#expect(terminalService.actions.count == 3)
#expect(terminalService.actions[0] == .ran(executableURL, ["init", pathFolder]))
#expect(terminalService.actions[1] == .ran(executableURL, ["-C", pathFolder, "add", "."]))
#expect(terminalService.actions[2] == .ran(executableURL, ["-C", pathFolder, "commit", "-m", "Initial commit"]))
}
}