misc: fix usage of deprecated SDK constants (#50)
Also fixed usage of deprecated matcher classes
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8c179c7..e802d7d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.0.5
+
+- Fix usage of SDK constants.
+
## 1.0.4
- Set max SDK version to <3.0.0.
diff --git a/lib/discovery.dart b/lib/discovery.dart
index 020d99a..57584b6 100644
--- a/lib/discovery.dart
+++ b/lib/discovery.dart
@@ -211,7 +211,7 @@
HttpClient client = new HttpClient();
HttpClientRequest request = await client.getUrl(uri);
HttpClientResponse response = await request.close();
- if (response.statusCode != HttpStatus.OK) {
+ if (response.statusCode != HttpStatus.ok) {
throw new HttpException('${response.statusCode} ${response.reasonPhrase}',
uri: uri);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index c584681..4bad1cf 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: package_config
-version: 1.0.4
+version: 1.0.5
description: Support for working with Package Resolution config files.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/package_config
@@ -12,4 +12,4 @@
path: ^1.0.0
dev_dependencies:
- test: ^1.0.0
+ test: ^1.3.0
diff --git a/test/discovery_test.dart b/test/discovery_test.dart
index 2c60db3..2824272 100644
--- a/test/discovery_test.dart
+++ b/test/discovery_test.dart
@@ -232,8 +232,8 @@
Uri file = directory.resolve(".packages");
expect(
loadPackagesFile(file),
- throwsA(anyOf(new isInstanceOf<FileSystemException>(),
- new isInstanceOf<HttpException>())));
+ throwsA(anyOf(new TypeMatcher<FileSystemException>(),
+ new TypeMatcher<HttpException>())));
});
generalTest("loadPackagesFile syntax error", {".packages": "syntax error"},
@@ -280,7 +280,7 @@
var serverSub;
var uri;
setUp(() {
- return HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ return HttpServer.bind(InternetAddress.loopbackIPv4, 0).then((server) {
uri = new Uri(
scheme: "http", host: "127.0.0.1", port: server.port, path: "/");
serverSub = server.listen((HttpRequest request) {