hgcummings/jarspec — pull request #18 by rowanhill (2014-07-12 22:40:55+00:00)
Title: Only execute root once

Just having a quick play, really, 'cos this looked like fun! I realise you're still chucking ideas around, etc, so feel free to completely ignore this. I just happened to notice it whilst I was playing around!

Prior to this change, testInstance.root() gets executed a lot - it feels like, as a consumer of jarspec, that would be very surprising to me: if I had any code in there that wasn't idempotent, it could cause me problems.

One thought having just re-read my change though: will I have broken error handling somehow? Exceptions thrown by executing root() will now happen when the runner is constructed, rather than when getDescription/run are called. I guess the idea is that root() doesn't throw exceptions (because all the actual test code is in the various lambdas)?

Good luck with this - interesting idea, if it doesn't pan out!