Open fabriciofx opened 4 years ago
@victornoel WDYT?
@fabriciofx I don't think we should allow for no message, since it is also enforced in qulice that there should be a message passed to assertions (even though it is only enforced for MatcherAssert, the intention is the same).
Concerning the second one, what would be the need? I don't see any
it is also enforced in qulice that there should be a message passed to assertions @victornoel It is forced by
forbidden-apis
@fabriciofx There could be a different Assertion
for that (See: https://github.com/llorllale/cactoos-matchers/issues/156).
For example, it would make sense to omit message if several assertions are grouped
new AllOf("must be ...", new Assertion<>(...), new Assertion<>(...))
@andreoss
@fabriciofx There could be a different
Assertion
for that (See: #156). For example, it would make sense to omit message if several assertions are groupednew AllOf("must be ...", new Assertion<>(...), new Assertion<>(...))
Your example is inverting the dependencies; it should be new Assertion<>("text", text, new AllOf<Text>(......))
@llorllale Good point, though it depends on how readable the output of matcher AllOf
will be
I was suggesting junit's approach
https://github.com/junit-team/junit5/blob/main/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java#L2910
https://github.com/junit-team/junit5/blob/main/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java
Let's add new constructors do
Assertion
to make it easier to use: