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.
Just following up on #6.
If the subscription already exists then its registration is already assigned a (real) listener. Calling
fakeonly 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 thefakein 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 onrestore.