Index: pkg/http/test/http_test.dart |
diff --git a/pkg/http/test/http_test.dart b/pkg/http/test/http_test.dart |
index 64e06d31a85cc9d9c7ac8a6df6cd2bf9afdd8c27..3b51e9dae5e4d7b78a70dc97648f717a33004b2a 100644 |
--- a/pkg/http/test/http_test.dart |
+++ b/pkg/http/test/http_test.dart |
@@ -16,10 +16,10 @@ main() { |
tearDown(stopServer); |
test('head', () { |
- expect(http.head(serverUrl).then(expectAsync1((response) { |
+ http.head(serverUrl).then(expectAsync1((response) { |
expect(response.statusCode, equals(200)); |
expect(response.body, equals('')); |
- })), completes); |
+ })); |
}); |
test('get', () { |
@@ -162,12 +162,13 @@ main() { |
}, |
})))); |
}); |
- |
+ |
test('read throws an error for a 4** status code', () { |
- expect(http.read(serverUrl.resolve('/error')).then((expectAsync1(x) => x)), |
- throwsHttpException); |
+ http.read(serverUrl.resolve('/error')).catchError(expectAsync1((e) { |
+ expect(true, e.error is HttpException); |
+ })); |
}); |
- |
+ |
test('readBytes', () { |
var future = http.readBytes(serverUrl, headers: { |
'X-Random-Header': 'Value', |
@@ -186,8 +187,9 @@ main() { |
}); |
test('readBytes throws an error for a 4** status code', () { |
- expect(http.readBytes(serverUrl.resolve('/error')).then((expectAsync1(x) => x)), |
- throwsHttpException); |
+ http.readBytes(serverUrl.resolve('/error')).catchError(expectAsync1((e) { |
+ expect(true, e.error is HttpException); |
+ })); |
}); |
}); |
} |