Skip to content

Commit 7ac1153

Browse files
committed
Update test
1 parent 6476438 commit 7ac1153

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Tests/AppTests/AnalyzerTests.swift

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,19 +1158,13 @@ extension AllTests.AnalyzerTests {
11581158
}
11591159

11601160
@Test func processingEnvironmentVariable() async throws {
1161-
let environment = QueueIsolated<[String: String]?>(nil)
11621161
try await withDependencies {
1163-
$0.fileManager.fileExists = { _ in true }
1164-
$0.shell.run = { @Sendable _, _, env in
1165-
environment.setValue(env)
1166-
return #"{"name":"foo","products":[],"targets":[]}"#
1167-
}
1162+
$0.logger = .noop
1163+
$0.shell = .liveValue
11681164
} operation: {
1169-
_ = try await Analyze.dumpPackage(at: "/somepath")
1170-
try environment.withValue {
1171-
let keys = try #require($0?.keys)
1172-
#expect(keys.contains("SPI_PROCESSING"))
1173-
}
1165+
@Dependency(\.shell) var shell
1166+
let res = try await shell.run(command: .init(command: "printenv", arguments: ["SPI_PROCESSING"]), at: "/tmp")
1167+
#expect(res == "1")
11741168
}
11751169
}
11761170

0 commit comments

Comments
 (0)