-
Notifications
You must be signed in to change notification settings - Fork 160
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
Generic support for thenReturn
and thenAnswer
#101
Conversation
I'd rather not land the change until we figure out who is going to do the work. We've had problems with packages getting way out of sync because no-one signed up for landing the patch. |
That's fair. That being said landing this change sooner than later will be beneficial for the Dart 2.0 work. These issues will crop up once the VM has the new semantics. |
O I'm not saying that we don't need to find someone to land it. Just I want to find that someone. |
You could put this in @srawlins planned "3.0.0" change? |
pubspec.yaml
Outdated
@@ -1,5 +1,5 @@ | |||
name: mockito | |||
version: 3.0.0-alpha | |||
version: 3.0.0 |
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.
Why change this?
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.
alpha has already been released.
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.
True. Let's call it 3.0.0-dev
for now, and not release it. 3.0.0 will be released not super soon, like March probably. I don't want anyone with an itchy trigger finger to publish 3.0.0 till it's ready.
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.
Done.
@@ -260,8 +260,8 @@ void main() { | |||
}); | |||
|
|||
test("should return mock to make simple oneline mocks", () { | |||
RealClass mockWithSetup = | |||
when(new MockedClass().methodWithoutArgs()).thenReturn("oneline"); | |||
RealClass mockWithSetup = new MockedClass(); |
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.
Note this was a type error found by the new implementation :D
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.
Woohoo!
pubspec.yaml
Outdated
@@ -1,5 +1,5 @@ | |||
name: mockito | |||
version: 3.0.0-alpha | |||
version: 3.0.0 |
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.
alpha has already been released.
Thanks Gary, love it! |
Generic support for `thenReturn` and `thenAnswer`
* master: Remove upper case constants (#113) Bump to 3.0.0-alpha+3 (#112) Switch back to Chrome for Travis (#104) Try using a staged, fancy travis config. (#100) Update travis script to actually run dartanalyzer (#102) verify*Interactions methods throw helpfully that they expect Mock (#92) First draft of upgrade guide for Mockito 3.0 (#96) Generic support for `thenReturn` and `thenAnswer` (#101) Remove references to `@proxy`. (#99) Remove Spy docs (#97) Remove mirrors implementation (#91)
I have been running into these errors as I have migrated folks over to DDC. Thankfully they can be caught through analysis instead of runtime. Unfortunately, it will be a huge pain in the ass to pull into Google3. We'll see who that works lands on :P