-
Notifications
You must be signed in to change notification settings - Fork 161
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
Mockito without mirrors? #27
Comments
It looks like the only invocation of true mirrors is dynamic spy(dynamic mock, dynamic spiedObject) {
var mirror = reflect(spiedObject);
mock._defaultResponse = () => new CannedResponse(
null, (Invocation realInvocation) => mirror.delegate(realInvocation));
return mock;
} I imagine this could be moved to mockito/spy.dart. The rest of mirrors uses |
It looks like |
Yep seems reasonable. Anyone want to send a pull request? I imagine we shouldn't have a breaking change for this. So have the original entrypoint export spy.dart, and mock.dart (or something like that,) and have AOT just import the second one. |
@Hixie does that sound OK? We'd have:
|
sgtm |
and thanks for looking at this so quickly! much appreciated. |
@TedSander I'll shoot you a PR shortly 💋 |
@Hixie of course! |
Alright, take a look at PR https://github.com/fibulwinter/dart-mockito/pull/28 |
Thanks! |
Would it be possible to create a version of mockito that doesn't use dart:mirrors? That would enable mockito to be used in environments that disable the mirrors support.
The text was updated successfully, but these errors were encountered: