Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: pkg/http/test/mock_client_test.dart

Issue 11293289: Make the HTTP MockClient work with GET requests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/mock_client_test.dart
diff --git a/pkg/http/test/mock_client_test.dart b/pkg/http/test/mock_client_test.dart
index 2425467c98a34a51507969209a9eb07bc1c88cee..7bc39566ff7e780907c0ae8ffb507d8ed68e956d 100644
--- a/pkg/http/test/mock_client_test.dart
+++ b/pkg/http/test/mock_client_test.dart
@@ -54,4 +54,13 @@ void main() {
.transform((response) => response.body);
expect(future, completion(equals('Request body was "hello, world"')));
});
+
+ test('handles a request with no body', () {
+ var client = new MockClient((request) {
+ return new Future.immediate(new http.Response('you did it', 200));
+ });
+
+ expect(client.read("http://example.com/foo"),
+ completion(equals('you did it')));
+ });
}
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698