Make have_received complain if passed a block
requested to merge github/fork/timcowlishaw/feature-have-received-complains-if-passed-a-block into master
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.