feat: Removes cli-client
This commit is contained in:
@@ -26,13 +26,22 @@ struct ConfigurationClientTests: TestCase {
|
||||
|
||||
try await withTemporaryDirectory { tempDir in
|
||||
let tempFile = tempDir.appending(path: fileName)
|
||||
try await configuration.generate(at: File(tempFile)!, force: false)
|
||||
let output = try await configuration.generate(.init(
|
||||
force: false,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(File(tempFile)!)
|
||||
))
|
||||
#expect(FileManager.default.fileExists(atPath: tempFile.cleanFilePath))
|
||||
#expect(fileClient.fileExists(tempFile))
|
||||
#expect(output == tempFile.cleanFilePath)
|
||||
|
||||
// Ensure that we do not overwrite files if they exist.
|
||||
do {
|
||||
try await configuration.generate(at: File(tempFile)!, force: false)
|
||||
_ = try await configuration.generate(.init(
|
||||
force: false,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(File(tempFile)!)
|
||||
))
|
||||
#expect(Bool(false))
|
||||
} catch {
|
||||
#expect(Bool(true))
|
||||
@@ -150,7 +159,11 @@ func withGeneratedConfigFile(
|
||||
) async rethrows {
|
||||
try await withTemporaryDirectory { tempDir in
|
||||
let file = File(tempDir.appending(path: fileName))!
|
||||
try await client.generate(at: file)
|
||||
_ = try await client.generate(.init(
|
||||
force: true,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(file)
|
||||
))
|
||||
try await operation(file)
|
||||
}
|
||||
}
|
||||
@@ -167,7 +180,11 @@ func withGeneratedXDGConfigFile(
|
||||
withIntermediateDirectories: false
|
||||
)
|
||||
let file = File(xdgDir.appending(path: fileName))!
|
||||
try await client.generate(at: file)
|
||||
_ = try await client.generate(.init(
|
||||
force: true,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(file)
|
||||
))
|
||||
try await operation(file, tempDir)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user