speculoos
speculoos copied to clipboard
Implement soft assertion
it would be nice to have soft assertions.
The API could look like this :
let softly = SoftAssertions::new();
softly.assert_that(mansion.guests()).as("Living guest").is_equal_to(7);
softly.assert_that(mansion.kitchen()).as("Kitchen").is_equal_to("clean");
softly.asser_that(mansion.library()).as("Library").is_equal_to("clean");
softly.assert_all();
resulting in the following :
1) [Living Guests] expected:<[7]> but was:<[6]>
2) [Library] expected:<"clean"> but was:<"messy">
3) [Kitchen] expected:<"clean"> but was:<"dirty">