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

Throw an ArgumentError if thenReturn is called with futures or streams. #88

Merged
merged 2 commits into from
Dec 12, 2017

Conversation

alanrussian
Copy link
Contributor

Also, documented this behavior in the README.

This fixes #79.

Also, documented this behavior in the README.

This fixes dart-lang#79.
@alanrussian
Copy link
Contributor Author

I updated the change log to document this since it's a breaking change. I just put down version number 2.3.0. Let me know if I should change it.

@alanrussian
Copy link
Contributor Author

Looks like this is failing on Dart 1.21.1, because assert message support wasn't added until Dart 1.22.

I think providing a message is valuable, so I'll change this to return an ArgumentError.

This will allow us to support Dart versions that don't support assert messages.
@alanrussian alanrussian changed the title Assert that thenReturn isn't called with futures nor streams. Throw an ArgumentError if thenReturn is called with futures or streams. Nov 29, 2017
@kevmoo kevmoo requested a review from srawlins November 30, 2017 06:50
@TedSander TedSander merged commit bbc5117 into dart-lang:master Dec 12, 2017
@@ -1,3 +1,9 @@
## 2.3.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Sort of late, but this should be 3.0.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fix here... the pubspec wasn't updated either: #89

srawlins added a commit that referenced this pull request Feb 8, 2018
* master:
  Capture T in `verify`+ so T may be `void` in dart 2: `verify(m.void())` (#90)
  Tag the version as 3.0.0-alpha
  Bump version to 3.0.0 (#89)
  Throw an ArgumentError if `thenReturn` is called with futures or streams. (#88)
  Fix uses_dynamic_as_bottom error (#86)
  Remove Dev from the pubspec version
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.

Push users to .thenAnswer(<Future|Stream>)?
4 participants