         XCTAssertEqual(output.readAll(), "alpha\nbeta\n")
     }
     
-    func testPipe() {
+    func testPipe() throws {
+        let path = "/tmp/_swiftcli"
+        try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
+        FileManager.default.createFile(atPath: path + "/Info.plist", contents: nil, attributes: nil)
+        FileManager.default.createFile(atPath: path + "/LinuxMain.swift", contents: nil, attributes: nil)
+        FileManager.default.createFile(atPath: path + "/SwiftCLITests", contents: nil, attributes: nil)
+        defer { try! FileManager.default.removeItem(atPath: path) }
+        
         let connector = PipeStream()
         let output = PipeStream()
         
-        let ls = Task(executable: "ls", args: ["Tests"], stdout: connector)
+        let ls = Task(executable: "ls", args: [path], stdout: connector)
         let grep = Task(executable: "grep", args: ["Swift"], stdout: output, stdin: connector)
         
         ls.runAsync()

    }
    
    func testCapture() throws {
        let output = try capture("/bin/ls", "Sources")
        XCTAssertEqual(output.stdout, "SwiftCLI")
        XCTAssertEqual(output.stderr, "")
    }
    
    func testExecutableFind() throws {
        XCTAssertEqual(Task.findExecutable(named: "ls"), "/bin/ls")
        
        let output = try capture("ls", "Sources")
        XCTAssertEqual(output.stdout, "SwiftCLI")
        XCTAssertEqual(output.stderr, "")
    }

    }
    
    func testBashCapture() throws {
        let path = "/tmp/_swiftcli"
        try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
        FileManager.default.createFile(atPath: path + "/SwiftCLI", contents: nil, attributes: nil)
        defer { try! FileManager.default.removeItem(atPath: path) }
        
        let output = try capture(bash: "ls \(path)")
        XCTAssertEqual(output.stdout, "SwiftCLI")
        XCTAssertEqual(output.stderr, "")
    }
