Open
Description
There are a number of places in the API where it would be good to add a String parameter to name something or add some context. Some quick examples from existing open issues:
- failures Naming a failure #526
eachHaving()
Consider making the semantics ofextracting
more similar tohaving
#533 (this is a name rather than more general context but it's the same basic idea)- some replacement for
Truth.assertWithMessage()
Feature Request: Add description tomatchesPredicate
assertion #514, Add custom information to an assertion error message. #352 all()
andany()
this issue comment
It seems like there are two main threads to these:
- API consistency (e.g.
eachHaving()
should have a name param to matchhaving()
) - Adding context to assertions (e.g. Naming a failure #526, )
I thought it would be useful to open an issue to kind of unify discussion around these ideas.
It would potentially be useful to go through the whole API and try to find the places where a string parameter seems to be wanted and try to design a consistent approach, rather than dealing with each request in an ad-hoc way.
Point 1. seems fairly easy to address, so I'll try to start collecting instances of that.