Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make testProvided's lambda extend TestProvidedCoroutineScope #179

Closed
RBusarow opened this issue Oct 18, 2020 · 0 comments
Closed

Make testProvided's lambda extend TestProvidedCoroutineScope #179

RBusarow opened this issue Oct 18, 2020 · 0 comments
Labels
Breaking Change enhancement New feature or request
Milestone

Comments

@RBusarow
Copy link
Owner

Currently testProvided's lambda receives a TestCoroutineScope. This gives the extra functionality from TestCoroutineDispatcher. TestProvidedCoroutineScope implements TestCoroutineScope.

TestProvidedCoroutineScope doesn't offer any new functionality by way of properties or functions, and the benefits from DispatcherProvider don't require that it's declared as any specific type. So there are two benefits of receiving a TestProvidedCoroutineScope over an ordinary TestCoroutineScope:

  1. The Dispatch version implements all specific CoroutineScope types, so it can be used as an argument regardless of the parameter type.
  2. Any future addition to the scope's API would then require this change, so doing it now is future-proofing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant