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 does what I want, by hijacking the and_return block (see http://gist.github.com/428624). But this doesn't work for more complex cases where there are multiple calls in the code under test which pass different blocks. Is there any way to make assertions like this? From looking at the code, I think it would take some significant changes to support this; but it doesn't seem to be a terribly esoteric use case. Thanks for any suggestions. -Ben
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users