expect method

void expect(
  1. String method,
  2. String path,
  3. Handler handler
)

Expects that a single HTTP request with the given method and path will be made to this.

The path should be root-relative; that is, it shuld start with "/".

When a matching request is made, handler is used to handle that request.

If this and/or expectAnything are called multiple times, the requests are expected to occur in the same order.

Implementation

void expect(String method, String path, Handler handler) {
  _expectations.add(Expectation(method, path, handler));
}