diff --git a/Tests/CartonCommandTests/BundleCommandTests.swift b/Tests/CartonCommandTests/BundleCommandTests.swift index 7b5a203..15358e3 100644 --- a/Tests/CartonCommandTests/BundleCommandTests.swift +++ b/Tests/CartonCommandTests/BundleCommandTests.swift @@ -22,6 +22,8 @@ import XCTest final class BundleCommandTests: XCTestCase { func testWithNoArguments() async throws { + let fs = localFileSystem + try await withFixture("EchoExecutable") { packageDirectory in let bundleDirectory = packageDirectory.appending(component: "Bundle") @@ -29,7 +31,7 @@ final class BundleCommandTests: XCTestCase { try result.checkNonZeroExit() // Confirm that the files are actually in the folder - XCTAssertTrue(bundleDirectory.exists, "The Bundle directory should exist") + XCTAssertTrue(fs.isDirectory(bundleDirectory), "The Bundle directory should exist") XCTAssertTrue(bundleDirectory.ls().contains("index.html"), "Bundle does not have index.html") XCTAssertFalse( (bundleDirectory.ls().filter { $0.contains("wasm") }).isEmpty, diff --git a/Tests/CartonCommandTests/Testable.swift b/Tests/CartonCommandTests/Testable.swift index 3e1a5a5..eeca8ec 100644 --- a/Tests/CartonCommandTests/Testable.swift +++ b/Tests/CartonCommandTests/Testable.swift @@ -58,10 +58,6 @@ func withFixture(_ name: String, _ body: (AbsolutePath) async throws -> Void) as } extension AbsolutePath { - var exists: Bool { - FileManager.default.fileExists(atPath: pathString) - } - func ls() -> [String] { guard let paths = try? FileManager.default.subpathsOfDirectory(atPath: pathString) else { return [] }