-
Notifications
You must be signed in to change notification settings - Fork 163
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
Enable MockSpec superclasses #728
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR. Please file a bug describing what this is fixing. We also need tests showing what would fail without the changes in |
Issue opened with example test: #729 |
Any update on this thread? There's some approvers? |
Sorry for the delay: this project has only a single mantainer, who has more urgent tasks most of the time. Re: discussion on the bug: It's a pity we can't have a I still don't quite like your solution though: surely, it works for your case with class MyMockSpec<T> extends MockSpec<T> {
const MyMockSpec();
@override
final fallbackGenerators = const {#x: fallback};
} Your code would simply ignore it. Furthermore, it's technically possible now to implement To cover all cases we need to call class MyMockSpecForFoo extends MockSpec<Foo> {}
class MyMockSpecForListT<T> extends MockSpec<List<T>> {} Would you be up for covering all of this? Especially provided that I want to do the next major release by the end of the end, hoping to be able to drop the fallback generators concept entirely. Privided there is no Analyzer API to help us here, personally I kinda feel the the code complication doesn't worth the improvement. But if you still want to follow this route, please also add cases cases covering various way to subtype As a workaround you can define your fallback generators as a top-level |
@@ -1,3 +1,7 @@ | |||
## 5.4.5-wip | |||
|
|||
* Allow usage of GetMock superclasses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Allow usage of GetMock superclasses. | |
* Allow usage of MockSpec subclasses. |
In this PR I add a check on mockSpec type to be sure that is an effective MockSpec and not an extension of it. In this way we could use a MockSpec superclass to use default constructor parameters or added values.
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.