Skip to content

Instantly share code, notes, and snippets.

@mchmielarz
Created December 14, 2019 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchmielarz/195d7e201212877046838defa04cf134 to your computer and use it in GitHub Desktop.
Save mchmielarz/195d7e201212877046838defa04cf134 to your computer and use it in GitHub Desktop.
Assumptions examples from assertj-vavr v0.2.0
// given
Option<String> empty = Option.none();
// this one fails
assumeThat(empty).isDefined();
// so the assertion won't be checked and test is ignored
assertThat(empty).contains("yay!);
// given
Either<String, Integer> value = Either.right(42);
// this oone passes
assumeThat(value).isRight();
// so the assertion is checked
assertThat(value).containsRight(42);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment