Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
misc: support Dart 2 stable (#34)
Browse files Browse the repository at this point in the history
Also fix deprecations in tests
  • Loading branch information
kevmoo authored Jul 20, 2018
1 parent a00f8bd commit d54cc3e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 0 additions & 2 deletions analysis_options.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: json_rpc_2
version: 2.0.8
version: 2.0.9
author: Dart Team <[email protected]>
description: An implementation of the JSON-RPC 2.0 spec.
homepage: http://github.com/dart-lang/json_rpc_2

environment:
sdk: ">=2.0.0-dev.17.0 <3.0.0"

dependencies:
stack_trace: '>=0.9.1 <2.0.0'
stream_channel: '^1.1.0'

dev_dependencies:
test: "^0.12.28"
environment:
sdk: ">=2.0.0-dev.17.0 <2.0.0"
test: ^1.0.0
6 changes: 3 additions & 3 deletions test/client/client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void main() {

test("sends a synchronous batch of requests", () {
controller.expectRequest((request) {
expect(request, new isInstanceOf<List>());
expect(request, new TypeMatcher<List>());
expect(request, hasLength(3));
expect(request[0], equals({'jsonrpc': '2.0', 'method': 'foo'}));
expect(
Expand Down Expand Up @@ -101,7 +101,7 @@ void main() {

test("sends an asynchronous batch of requests", () {
controller.expectRequest((request) {
expect(request, new isInstanceOf<List>());
expect(request, new TypeMatcher<List>());
expect(request, hasLength(3));
expect(request[0], equals({'jsonrpc': '2.0', 'method': 'foo'}));
expect(
Expand Down Expand Up @@ -157,7 +157,7 @@ void main() {

expect(controller.client.sendRequest("foo", {'param': 'value'}),
throwsA(predicate((exception) {
expect(exception, new isInstanceOf<json_rpc.RpcException>());
expect(exception, new TypeMatcher<json_rpc.RpcException>());
expect(exception.code, equals(error_code.SERVER_ERROR));
expect(exception.message, equals('you are bad at requests'));
expect(exception.data, equals('some junk'));
Expand Down
4 changes: 2 additions & 2 deletions test/server/server_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void main() {
'data': {
'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234},
'full': 'FormatException: bad format',
'stack': new isInstanceOf<String>()
'stack': new TypeMatcher<String>()
}
}
}));
Expand Down Expand Up @@ -168,7 +168,7 @@ void main() {
'data': {
'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234},
'full': 'FormatException: bad format',
'stack': new isInstanceOf<String>()
'stack': new TypeMatcher<String>()
}
}
}));
Expand Down
2 changes: 1 addition & 1 deletion test/server/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void expectErrorResponse(
/// `invalid_params` error code.
Matcher throwsInvalidParams(String message) {
return throwsA(predicate((error) {
expect(error, new isInstanceOf<json_rpc.RpcException>());
expect(error, new TypeMatcher<json_rpc.RpcException>());
expect(error.code, equals(error_code.INVALID_PARAMS));
expect(error.message, equals(message));
return true;
Expand Down

0 comments on commit d54cc3e

Please sign in to comment.