         XCTAssertEqual(task3.finish(), 15)
     }
     
-    func testTaskLineStream() {
+    func testTaskLineStream() 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) }
+        
         var count = 0
         let lineStream = LineStream { (line) in
             count += 1
         }
-        let task = Task(executable: "ls", args: ["Tests"], stdout: lineStream)
+        let task = Task(executable: "ls", args: [path], stdout: lineStream)
         XCTAssertEqual(task.runSync(), 0)
         
         lineStream.wait()

        XCTAssertEqual(output.readAll(), "SwiftCLITests\n")
    }
    
    func testCurrentDirectory() {
        let capture = PipeStream()
        
        let ls = Task(executable: "ls", currentDirectory: "Sources", stdout: capture)
        ls.runSync()
        
        XCTAssertEqual(capture.readAll(), "SwiftCLI\n")

        XCTAssertEqual(output.readAll(), "alpha\nbeta\n")
    }
    
    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: [path], stdout: connector)
        let grep = Task(executable: "grep", args: ["Swift"], stdout: output, stdin: connector)
        
        ls.runAsync()
