fix: Fixes failing tests since we create backups now during configuration generation.
This commit is contained in:
@@ -114,8 +114,8 @@ let package = Package(
|
||||
.target(
|
||||
name: "PlaybookClient",
|
||||
dependencies: [
|
||||
"CodersClient",
|
||||
"CommandClient",
|
||||
"CodersClient",
|
||||
"ConfigurationClient",
|
||||
"FileClient",
|
||||
.product(name: "Dependencies", package: "swift-dependencies"),
|
||||
|
||||
@@ -35,18 +35,6 @@ struct ConfigurationClientTests: TestCase {
|
||||
#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(.init(
|
||||
force: false,
|
||||
json: fileName.hasSuffix("json"),
|
||||
path: .file(File(tempFile)!)
|
||||
))
|
||||
#expect(Bool(false))
|
||||
} catch {
|
||||
#expect(Bool(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,7 +140,7 @@ struct ConfigurationClientTests: TestCase {
|
||||
try await withGeneratedConfigFile(named: "config.toml", client: client) { configFile in
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
|
||||
let backupUrl = configFile.url.appendingPathExtension(".back")
|
||||
let backupUrl = configFile.url.appendingPathExtension("back")
|
||||
#expect(fileClient.fileExists(backupUrl) == false)
|
||||
|
||||
let config = Configuration()
|
||||
|
||||
Reference in New Issue
Block a user