I run my HSpec tests both locally and in the CI. The default specdoc
formatter produces nice, colored stdio output. However, for the CI, I need the results in the XML format so that they can be presented on the web.
I added my XML format to the HSpec config, but that disabled the stdio output altogether. I've tried hacking the formatter so that it ran both formatting commands, but that just resulted in an XML file with mixed text and XML messages (since there's only one configOutputFile
option).
A few options at this point are:
- To run the tests twice, once with each formatter
- To run the tests with
silent
formatter and then somehow try to run the fomatters on the results. - To hack my formatter output so that e.g. some commands go straight to stdio.
Neither of those sound particularly easy and straightforward. Is there a better way? Being able to use just one Formatter at once sounds like a rather annoying limitation.