Skip to content

and_iterates/and_yields should handle enumerator chains #12

@npepinpe

Description

@npepinpe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions