Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Too strong restriction for matchers #1055

@nepalez

Description

@nepalez

Seems like the requirement only the 'receive', 'have_received' and 'receive_messages' matchers are supported with 'allow(...).to' is too restrictive.

For example, I provide the matcher, that is sort of semi-transparent extension for the receive

I believe it could work, but it doesn't because of the restriction above. Do we really need it?

Surely, I could just reload the receive method (and actually I did) and then monkey-patch the whole RSpec::Mocks::Matchers::Receive class. But also I do need to reload both the allow and expect to switch client to client.connection. It works, but seems far too messy, not to mention dark sides of monkey patching by itself.

I think, it would be far better way to allow developer to shoot himself 🔫 in the foot, not restricting him so strongly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions