Open
Description
From a purely JUnit5 perspective, am I missing something?
I made this wrapper around the core Expect function:
public class ThingyThing {
public static void softly(final SoftAssertions softly) throws Throwable {
Expect expect = Expect.create();
expect.apply(new Statement() {
@Override
public void evaluate() throws Throwable {
softly.apply(expect);
}
}, Description.EMPTY)
.evaluate();
}
public interface SoftAssertions{
void apply(final Expect expect);
}
}
Used like:
ThingyThing.softly(expector -> {
expector.that(1).isEqualTo(2);
expector.that(-1).isGreaterThan(0);
});
Outputs:
2 expectations failed:
1. expected: 2
but was : 1
at io.<snip>.ThingTest.lambda$testRemit$0(ThingTest.java:113)
2. expected to be greater than: 0
but was : -1
at io.<snip>.ThingTest.lambda$testRemit$0(ThingTest.java:114)
P.s. amazing framework BTW - beautiful. Especially for chained custom objects. Amazing. Wish I'd found it sooner.
Activity