Skip to content

Commit 914afc0

Browse files
committed
test: avoid host-dependent update diagnostics fixture
1 parent 33feefa commit 914afc0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Tests/RepoBarTests/UpdateDiagnosticsTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ import Testing
44

55
struct UpdateDiagnosticsTests {
66
@Test
7-
func `diagnostics include update location and install-origin signals`() throws {
8-
let bundleURL = try #require(URL(string: "file:///Applications/RepoBar.app"))
7+
func `diagnostics include update location and install-origin signals`() {
8+
let bundleURL = FileManager.default.temporaryDirectory
9+
.appending(path: "RepoBarDiagnosticsFixture", directoryHint: .isDirectory)
10+
.appending(path: "RepoBar.app", directoryHint: .isDirectory)
911
let diagnostics = UpdateDiagnostics(
1012
bundleURL: bundleURL,
1113
canCheckForUpdates: true,
1214
developerIDSigned: true,
1315
quarantineReader: { _ in true }
1416
)
1517

16-
#expect(diagnostics.bundlePath == "/Applications/RepoBar.app")
18+
#expect(diagnostics.bundlePath == bundleURL.path)
1719
#expect(diagnostics.canCheckForUpdates)
1820
#expect(diagnostics.developerIDSigned)
1921
#expect(!diagnostics.homebrewCask)
2022
#expect(!diagnostics.appTranslocated)
2123
#expect(diagnostics.quarantinePresent)
22-
#expect(diagnostics.pasteboardText.contains("bundle_path: /Applications/RepoBar.app"))
24+
#expect(diagnostics.pasteboardText.contains("bundle_path: \(bundleURL.path)"))
2325
#expect(diagnostics.pasteboardText.contains("quarantine_present: true"))
2426
}
2527

0 commit comments

Comments
 (0)