captureStdout

fun captureStdout(block: () -> Unit): String

Captures everything printed to System.out during execution of block and returns it as a String.

Return

the captured stdout output

Parameters

block

the code to execute while capturing stdout