Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

feat(mocks): change MockHttpBackend to define assertions on flush. #1433

Closed
wants to merge 2 commits into from

Conversation

vsavkin
Copy link
Contributor

@vsavkin vsavkin commented Sep 7, 2014

There was a mixup with merging #1206.
This is the same PR rebased on top of master.

Add new methods (`flushGET`, `flushPOST`, etc) to the `MockHttpBackend` class to allow defining assertions on flush. These methods add a new expectation and then flush all the pending requests until they find the one matching the expectation.

BREAKING CHANGE:

Unexpected requests are detected only when `flush` is called.

Before:

		backend("GET", /some"); //throws here if `/some` has not been defined

After:

		backend("GET", /some"); //no problem, just records the request
		backend.flush(); //throws here

Closes dart-archive#900
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants