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

Generic support for thenReturn and thenAnswer #101

Merged
merged 2 commits into from
Feb 21, 2018
Merged

Generic support for thenReturn and thenAnswer #101

merged 2 commits into from
Feb 21, 2018

Conversation

grouma
Copy link
Member

@grouma grouma commented Feb 16, 2018

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

@TedSander
Copy link
Contributor

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.

@grouma
Copy link
Member Author

grouma commented Feb 16, 2018

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.

@TedSander
Copy link
Contributor

O I'm not saying that we don't need to find someone to land it. Just I want to find that someone.

@matanlurey
Copy link
Contributor

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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();
Copy link
Member Author

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

Copy link
Member

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
Copy link
Member Author

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.

@srawlins srawlins merged commit 8fbf1b1 into master Feb 21, 2018
@srawlins srawlins deleted the generics branch February 21, 2018 00:53
@srawlins
Copy link
Member

Thanks Gary, love it!

srawlins pushed a commit to srawlins/dart-mockito that referenced this pull request Mar 23, 2018
Generic support for `thenReturn` and `thenAnswer`
srawlins added a commit that referenced this pull request Apr 16, 2018
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants