[rspec-users] (no subject)

2010-06-07 Thread Ben Butler-Cole
Hello. I'm trying to use RSpec's mocks to describe code which passes a block to a collaborator. I want to write an assertion against the value returned by the block. I can't find any explicit support for this in RSpec, but perhaps I have missed something. I have come up with a hack which almost d

Re: [rspec-users] mock assertions on block parameters

2010-06-07 Thread Ben Butler-Cole
On 7 June 2010 15:25, Matt Wynne wrote: Have you seen and_yield? I can't quite get my head around what you're trying > to do, but it might help anyway > Thank you, I have. My understanding is that #and_yield has much the same use as #and_return (in its non-bastardized-by-me-form). That is, you s

Re: [rspec-users] mock assertions on block parameters

2010-06-07 Thread Ben Butler-Cole
On 7 June 2010 16:34, Matt Wynne wrote: I'm still not quite clear what you're trying to achieve. Do you want to > assert that a specific block is passed to the collaborator, or do you want > to assert that any old block with a particular behaviour is passed to the > collaborator? > > If it's the