Displaying 1 result from an estimated 1 matches for "method_that_yield".
Did you mean:
method_that_yields
2007 Aug 06
1
Stubbing Enumerable#each
I have a mock of an instance of a class which descends from Array:
class ArrayDescendent < Array; end
#... in the specs...
@descendent = mock ArrayDescendent
How would I stub out ArrayDescendent#each, which is inherited from
Array, to return multiple values successively? I could use
and_yield, but that is raising an arity error (the anonymous function/
block should expect only *one