redstone-dart / redstone

A metadata driven microframework for Dart.
http://redstone-dart.github.io/redstone
MIT License
342 stars 42 forks source link

HTTP mocks are broken against the latest Shelf version #193

Open nex3 opened 8 years ago

nex3 commented 8 years ago

The most recent version of shelf uses HttpHeaders.chunkedTransferEncoding, which is not mocked by Redstone's mock class. This is causing test failures.

In general, you should never mock dart:io HTTP classes when working with Shelf. Shelf goes to great lengths to make apps built on it server-independent. By tightly coupling to dart:io in particular, you make it so that users can't run on any other server that may come along. It also makes testing much harder; you wouldn't need any mock classes if you could just test Redstone apps by passing shelf.Requests to a shelf.Handler and receiving shelf.Responses in return.

sestegra commented 8 years ago

Fixed by #194