Tracking the delivery
[Sep 2018] Is it there yet?! That’s not a trivial question to answer when testing whether a given closure is one we created. The ideal way, of course, is to use objects instead of closures. In practice, the craze of closures makes them unavoidable. In which case, we have to work with an opaque type (implying no properties to introspect) with value-type copy semantics (ruling out referential equality too). Thus the outside-looking-in strategy, direct testability, is closed off. However, it’s not totally hopeless. If we reverse our strategy, we can see that a messaging-out solution is still doable. To experiment with this idea in code, I posted a gist of a testcase. I hope this sparks your interest in expanding what is testable and reach higher coverage targets.