Skip to content

Commit e11a38b

Browse files
committed
Fix tests
1 parent db112a2 commit e11a38b

File tree

2 files changed

+3
-35
lines changed

2 files changed

+3
-35
lines changed

Sources/ShellOut.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,6 @@ public extension ShellOutCommand {
316316
.init(command: "swift".unchecked, arguments: ["package", "update"].verbatim)
317317
}
318318

319-
/// Generate an Xcode project for a Swift package
320-
static func generateSwiftPackageXcodeProject() -> ShellOutCommand {
321-
.init(command: "swift".unchecked,
322-
arguments: ["package", "generate-xcodeproj"].verbatim)
323-
}
324-
325319
/// Build a Swift package using a given configuration (see SwiftBuildConfiguration for options)
326320
static func buildSwiftPackage(withConfiguration configuration: SwiftBuildConfiguration = .debug) -> ShellOutCommand {
327321
.init(command: "swift".unchecked,

Tests/ShellOutTests/ShellOutTests.swift

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ class ShellOutTests: XCTestCase {
4242
}
4343

4444
func testSingleCommandAtPath() throws {
45+
let tempDir = NSTemporaryDirectory()
4546
try shellOut(
4647
to: "echo".checked,
47-
arguments: [#"Hello" > \#(NSTemporaryDirectory())ShellOutTests-SingleCommand.txt"#.quoted]
48+
arguments: ["Hello", ">".verbatim, "\(tempDir)ShellOutTests-SingleCommand.txt".quoted]
4849
)
4950

5051
let textFileContent = try shellOut(
5152
to: "cat".checked,
5253
arguments: ["ShellOutTests-SingleCommand.txt".quoted],
53-
at: NSTemporaryDirectory()
54+
at: tempDir
5455
)
5556

5657
XCTAssertEqual(textFileContent, "Hello")
@@ -180,33 +181,6 @@ class ShellOutTests: XCTestCase {
180181
XCTAssertEqual(try shellOut(to: .readFile(at: filePath)), "Hello again")
181182
}
182183

183-
func testSwiftPackageManagerCommands() throws {
184-
// Setup & clear state
185-
let tempFolderPath = NSTemporaryDirectory()
186-
try shellOut(to: "rm".checked,
187-
arguments: ["-rf", "SwiftPackageManagerTest"].verbatim,
188-
at: tempFolderPath)
189-
try shellOut(to: .createFolder(named: "SwiftPackageManagerTest"), at: tempFolderPath)
190-
191-
// Create a Swift package and verify that it has a Package.swift file
192-
let packagePath = tempFolderPath + "/SwiftPackageManagerTest"
193-
try shellOut(to: .createSwiftPackage(), at: packagePath)
194-
XCTAssertFalse(try shellOut(to: .readFile(at: packagePath + "/Package.swift")).isEmpty)
195-
196-
// Build the package and verify that there's a .build folder
197-
try shellOut(to: .buildSwiftPackage(), at: packagePath)
198-
XCTAssertTrue(
199-
try shellOut(to: "ls".checked, arguments: ["-a".verbatim], at: packagePath) .contains(".build")
200-
)
201-
202-
// Generate an Xcode project
203-
try shellOut(to: .generateSwiftPackageXcodeProject(), at: packagePath)
204-
XCTAssertTrue(
205-
try shellOut(to: "ls".checked, arguments: ["-a".verbatim], at: packagePath)
206-
.contains("SwiftPackageManagerTest.xcodeproj")
207-
)
208-
}
209-
210184
func testArgumentQuoting() throws {
211185
XCTAssertEqual(try shellOut(to: "echo".checked,
212186
arguments: ["foo ; echo bar".quoted]),

0 commit comments

Comments
 (0)