The function do_some_stuff(Pid)
generates two tests, so it's pretty normal both are checked and displayed.
You can however add a name/description to each generator & test:
do_some_tests_() ->
{foreach,
fun start/0,
fun stop/1,
[{"Doing some stuff" , fun do_some_stuff/1},
{"Doing some other stuff" , fun do_some_other_stuff/1}
]}.
do_some_stuff(Pid) ->
%% [code]
[
{"Check 200" , ?_assertMatch({ok, {{_, 200, _}, [], _}}, Any)},
{"Check httpc" , ?_assert(meck:validate(httpc))}
]
end.
This should display something in the likes of:
module 'MyModule'
Doing Some Stuff
module:57: do_some_stuff (Check 200)...ok
module:58: do_some_stuff (Check httpc)...ok
In EUnit parlance, these are know as "titles":
Titles
Any test or test set T can be annotated with a title, by wrapping it in a pair {Title, T}, where Title is a string. For convenience, any test which is normally represented using a tuple can simply be given a title string as the first element, i.e., writing {"The Title", ...} instead of adding an extra tuple wrapper as in {"The Title", {...}}.