You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flexmock(collection).should_receive(:each_batch).and_iterates(%w[abc],%[d e f])collection.each_batch.each_with_indexdo |batch,index|
...
end
Produces the following exception:
FlexMock::MockError: No Block given to mock with 'and_yield' expectation
Intuitively, I would have expected the above code to simply work. I'm not entirely sure how feasible it would be, and there are work-arounds, but it would be a nice to have.
The text was updated successfully, but these errors were encountered:
Let's forget about the implementation (which is probably somehow feasible), and discuss the feature first.
I see the point, especially given that I'm also prone to providing all my #each methods with the "return an enumerator if no block is given" pattern.
However, this is not a feature of the language... The 'yield-to-enumerator' conversion relies on code within the method, and I would assume that existing users of and_yields/and_iterates actually rely on this check. I would prefer a syntax that allows for both usage patterns. I'll need to think about it ... Suggestions ?
With version 2.3.5, using the following:
Produces the following exception:
Intuitively, I would have expected the above code to simply work. I'm not entirely sure how feasible it would be, and there are work-arounds, but it would be a nice to have.
The text was updated successfully, but these errors were encountered: