Skip to content

Make have_received complain if passed a block

Created by: timcowlishaw

I rather stupidly assumed I could use a block passed to have_received to make assertions about the arguments passed in a method call, in the same way that is possible with the 'receive' matcher. Ordinarily I wouldn't think such a mistake would warrant being guarded against in the test library itself, however, in this case the test silently passes, rather than erroring out. This patch makes have_received raise an exception if passed a block argument to make it clear that matching against arguments to the method call in this way is not possible.

Merge request reports