|
|
@ -100,12 +100,12 @@ request(path: "first"); |
|
|
|
request(path: "second"); |
|
|
|
request(path: "third"); |
|
|
|
|
|
|
|
// takeRequest is LIFO |
|
|
|
// takeRequest is FIFO |
|
|
|
// You should probably assign takeRequest() to a var so that you can |
|
|
|
// validate multiple things. |
|
|
|
expect(server.takeRequest().uri.path, "/third"); |
|
|
|
expect(server.takeRequest().method, "GET"); |
|
|
|
expect(server.takeRequest().headers['x-header'], "nosniff"); |
|
|
|
expect(server.takeRequest().method, "GET"); |
|
|
|
expect(server.takeRequest().uri.path, "/third"); |
|
|
|
``` |
|
|
|
|
|
|
|
### Using a dispatcher for fine-grained routing |
|
|
@ -191,4 +191,4 @@ MockWebServer _server = |
|
|
|
``` |
|
|
|
|
|
|
|
### Stopping |
|
|
|
During the `tearDown` of your tests you should stop the server. `server.shutdown()` will do. |
|
|
|
During the `tearDown` of your tests you should stop the server. `server.shutdown()` will do. |