Consider providing register_listener as a public API on Configuration
Created by: fireyone29
I'm trying to write a helper for some rspec tests that listens to all the pass/fail/pending messages and inspects example metadata as you might in a formatter, however I have no intention of ever outputting any sort of progress indication from this helper (because it's aggregating data in such a way that there is no meaningful intermediate state). This makes it exceedingly difficult to make the operation of this helper transparent to the user because that there's no way I can see to distinguish a formatter which doesn't want to be involved in the output from one that does. In other words, I'd like the behavior of a formatter but with the ability to not override the default formatter. If the CLI or the configuration defines another formatter, then there's no problem (because mine would simply be added to them).
Currently I can achieve the behavior I want by using the (private) reporter from a configuration and then its (public) register_listener api (I don't appear to need any other part of the reporter interface). But I can't see any way to achieve the same result using only public interfaces.
I've searched previous issues (although not exhaustively) and didn't see anything particularly helpful. However, I've seen people advise using the reporter interface on Configuration in a few places despite the fact that it's marked private, perhaps the easier way is just for it to be made public (or for me to treat it as such)?