Skip to content

fake and friends don't work on existing subscriptions #7

@textgoeshere

Description

@textgoeshere

Just following up on #6.

If the subscription already exists then its registration is already assigned a (real) listener. Calling fake only affects subsequent registrations. This is particularly a challenge where you are working with global listeners because you can't usually control their load order to get the fake in before the subscription.

Here's a failing spec that illustrates the issue: https://gist.github.com/14d09819e2c0ccb1bd23.

Assuming this isn't by design ;), do you like the idea of adding a step to walk over the existing registrations, memoize their broadcasters, and replace them with FakeBroadcaster? And reversing that on restore.

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