mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
update config explicitly
This commit is contained in:
@@ -23,24 +23,23 @@ class GhosttyCustomConfigCase: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
var customGhosttyConfig: String? {
|
||||
nil
|
||||
}
|
||||
|
||||
func ghosttyApplication() throws -> XCUIApplication {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments.append(contentsOf: ["-ApplePersistenceIgnoreState", "YES"])
|
||||
guard let customGhosttyConfig else {
|
||||
return app
|
||||
}
|
||||
func updateConfig(_ newConfig: String) throws {
|
||||
if let configFile {
|
||||
try FileManager.default.removeItem(at: configFile)
|
||||
}
|
||||
let temporaryConfig = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)
|
||||
.appendingPathExtension("ghostty")
|
||||
try customGhosttyConfig.write(to: temporaryConfig, atomically: true, encoding: .utf8)
|
||||
try newConfig.write(to: temporaryConfig, atomically: true, encoding: .utf8)
|
||||
configFile = temporaryConfig
|
||||
app.launchEnvironment["GHOSTTY_CONFIG_PATH"] = configFile?.path
|
||||
}
|
||||
|
||||
func ghosttyApplication() throws -> XCUIApplication {
|
||||
let app = XCUIApplication()
|
||||
app.launchArguments.append(contentsOf: ["-ApplePersistenceIgnoreState", "YES"])
|
||||
guard let configFile else {
|
||||
return app
|
||||
}
|
||||
app.launchEnvironment["GHOSTTY_CONFIG_PATH"] = configFile.path
|
||||
return app
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
import XCTest
|
||||
|
||||
final class GhosttyTitleUITests: GhosttyCustomConfigCase {
|
||||
|
||||
override var customGhosttyConfig: String? {
|
||||
#"title = "GhosttyUITestsLaunchTests""#
|
||||
override func setUp() async throws {
|
||||
try await super.setUp()
|
||||
try updateConfig(#"title = "GhosttyUITestsLaunchTests""#)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
import XCTest
|
||||
|
||||
final class GhosttyTitlebarTabsUITests: GhosttyCustomConfigCase {
|
||||
override var customGhosttyConfig: String? {
|
||||
"""
|
||||
macos-titlebar-style = tabs
|
||||
title = "GhosttyTitlebarTabsUITests"
|
||||
"""
|
||||
}
|
||||
override func setUp() async throws {
|
||||
try await super.setUp()
|
||||
|
||||
try updateConfig(
|
||||
"""
|
||||
macos-titlebar-style = tabs
|
||||
title = "GhosttyTitlebarTabsUITests"
|
||||
"""
|
||||
)
|
||||
}
|
||||
@MainActor
|
||||
func testCustomTitlebar() throws {
|
||||
let app = try ghosttyApplication()
|
||||
|
||||
Reference in New Issue
Block a user