[rspec-devel] should_yield (is it needed?)

Peter Fitzgibbons peter.fitzgibbons at gmail.com
Tue Dec 1 10:36:03 EST 2009

On Tue, Dec 1, 2009 at 6:55 AM, David Chelimsky <dchelimsky at gmail.com>wrote:
HI David and all,

This seems to me to fall into the expectations category.  We are setting
expectation that our method taking &block will yield such and such somewhere
I take this to be distinguished from mocking the yield, which appears to be
already captured well enough in Spec::Mocks::BaseExpectation#and_yield

So, going with this belonging to Spec::Matchers, then :

subject.method(args).should yield(values,to,yield)

If the method is expected to yield multiple times, then match as David
suggested :

subject.method(args).should yield_each_of(objects, yielded, in, iterations)

Unfortunately I do not have the ability yet to suggest internal
implementation.  Rspec already baffles my metaprogramming-fu... the stuff
we're discussing cleanly surpasses it.

Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibbons at gmail.com
IM GTalk: peter.fitzgibbons
IM AOL: peter.fitzgibbons at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-devel/attachments/20091201/b14c4fcb/attachment-0001.html>

More information about the rspec-devel mailing list