Skip to content

Commit 85d864e

Browse files
committed
fix pwd to return the absolute path of the working directory
1 parent 0582fc1 commit 85d864e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/main/java/io/github/benas/unixstream/UnixStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static UnixStream<Path> ls(final Path directory) throws IOException {
134134
* @return a new UnixStream with the absolute path of the current directory.
135135
*/
136136
static UnixStream<Path> pwd() {
137-
return new UnixStreamImpl<>(Stream.of(Paths.get("")));
137+
return new UnixStreamImpl<>(Stream.of(Paths.get("").toAbsolutePath()));
138138
}
139139

140140

src/test/java/io/github/benas/unixstream/components/PwdTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ public void pwd() throws IOException {
1818

1919
List<Path> paths = stream.collect(Collectors.toList());
2020

21-
// TODO toAbsolutePath should not be be called by the client
22-
assertThat(paths.get(0).toAbsolutePath().toString()).endsWith("unix-stream");
21+
assertThat(paths.get(0).toString()).endsWith("unix-stream");
2322
}
2423

2524
}

0 commit comments

Comments
 (0)