My colleague James just wrote about the idea of a special object that could be passed as a method parameter in a test to indicate that the parameter is irrelevant within the context of that particular test. He called it a Holy Hand Grenade:
I wonder if this idea could be extended by having a kind of holy hand-grenade object which “blows up” by raising an AssertionFailedError when any method is invoked on it…?
I’ve written a simple implementation in Ruby which, to paraphrase Fermat, this blog software is too limited to contain. (It really doesn’t like double underscores.) Fortunately, unlike Fermat, I have an alternative place to keep it: