With version 2.3.5, using the following:
flexmock(collection).should_receive(:each_batch).and_iterates(%w[a b c], %[d e f])
collection.each_batch.each_with_index do |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.