Skip to content

An assertion library to test processes or main() on the JVM.

License

Notifications You must be signed in to change notification settings

nelkinda/lib-systemtest

Repository files navigation

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

About

An assertion library to test processes or main() on the JVM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages