Skip to content

Commit 869b5b2

Browse files
committed
Cleaner code
1 parent eaf00e5 commit 869b5b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/demo/TerminalContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ public static String captureTerminal(final Runnable call) {
8585

8686
@Override
8787
public void close() {
88-
System.out.close(); // Points to the test-only output stream
89-
System.err.close(); // Points to the test-only output stream
88+
final PrintStream wrapper = System.out; // Shared with System.err
9089
System.setOut(originalOut);
9190
System.setErr(originalErr);
91+
wrapper.close();
9292
}
9393

9494
@Override

0 commit comments

Comments
 (0)