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

Bump to 3.0.0-alpha+3 #112

Merged
merged 1 commit into from
Apr 5, 2018
Merged

Bump to 3.0.0-alpha+3 #112

merged 1 commit into from
Apr 5, 2018

Conversation

srawlins
Copy link
Member

@srawlins srawlins commented Apr 5, 2018

This release allows projects to conform to the same type standards as internal code.

The most common way this restricts users of mockito is the following:

class MockFile extends Mock implements File {}

var f = new MockFile();
// Old: bad code returns a String where a Future<String> is expected.
when(f.readAsString()).thenReturn('text'));

// But no runtime errors are thrown because the return value is merely awaited.
var text = await f.readAsString();

// New: good code answers with an async closure that returns a String.
when(f.readAsString()).thenAnswer((_) async => 'text');

@srawlins srawlins requested a review from grouma April 5, 2018 23:14
@srawlins srawlins merged commit 4cf0b60 into dart-lang:master Apr 5, 2018
@srawlins srawlins deleted the alpha+3 branch April 5, 2018 23:29
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)
mosuem pushed a commit to dart-lang/test that referenced this pull request Oct 17, 2024
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.

3 participants