Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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