1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-04-05 10:50:07 +02:00

🏗 WIP: Shell rework

This commit is contained in:
2022-09-27 22:27:33 +02:00
parent 3483569410
commit a59efb7fce
4 changed files with 88 additions and 24 deletions

View File

@@ -12,8 +12,7 @@ class ShellTest: XCTestCase {
func test_default_shell_is_system_shell() {
XCTAssertTrue(Shell is SystemShell)
XCTAssertTrue(Shell.syncPipe("php -v")
.contains("Copyright (c) The PHP Group"))
XCTAssertTrue(Shell.sync("php -v").output.contains("Copyright (c) The PHP Group"))
}
func test_system_shell_has_path() {
@@ -45,8 +44,14 @@ class ShellTest: XCTestCase {
XCTAssertTrue(Shell is TestableShell)
XCTAssertEqual(expectedPhpOutput, Shell.syncPipe("php -v"))
XCTAssertEqual(expectedPhpOutput, Shell.sync("php -v").output)
XCTAssertEqual(expectedPhpOutput, Shell.syncPipe("php --version"))
XCTAssertEqual(expectedPhpOutput, Shell.sync("php --version").output)
}
func test_unrecognized_commands_output_stderr() {
ActiveShell.useTestable([:])
XCTAssertEqual("Unexpected Command", Shell.sync("unrecognized command").output)
}
}