A library to test JVM functions and programs behavior on System.out
, System.err
, and System.exit()
.
- Developers of command line tools on the JVM.
- Teachers and Students that work on JVM languages and want to verify assignments that operate on System.out.
- Trainers of Test-Driven Development.
- Java 8 JRE
- The library depends on the JUnit5 API but should work quite well also with TestNG or Cucumber.
It has been developed in Java, but should also work quite nicely in other JVM-languages like Kotlin, Groovy, Scala, and Clojure.
import org.junit.jupiter.api.Test;
import static com.nelkinda.systemassert.SystemAssertions.assertProc;
class HelloTest {
@Test
void printsHelloWorld() {
assertProc(Hello::main)
.hadStdout("Hello, world!\n")
.hadStderr("")
.withSuccess();
}
}
The reports are available locally, after running a build using make pipeline