Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 2.54 KB

README.md

File metadata and controls

58 lines (47 loc) · 2.54 KB

lib-systemtest

A library to test JVM functions and programs behavior on System.out, System.err, and System.exit().

GitHub CI/CD

Target Audience

  • 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.

Dependencies/Requirements

  • 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.

Example

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();
    }
}

Reports

The reports are available locally, after running a build using make pipeline

lib-systemassert

examples