diff --git a/.dart_tool/pub/bin/sdk-version b/.dart_tool/pub/bin/sdk-version new file mode 100644 index 00000000..227cea21 --- /dev/null +++ b/.dart_tool/pub/bin/sdk-version @@ -0,0 +1 @@ +2.0.0 diff --git a/.dart_tool/pub/bin/test/test.dart.snapshot.dart2 b/.dart_tool/pub/bin/test/test.dart.snapshot.dart2 new file mode 100644 index 00000000..76193dd9 Binary files /dev/null and b/.dart_tool/pub/bin/test/test.dart.snapshot.dart2 differ diff --git a/CHANGELOG.md b/CHANGELOG.md index b63b05bb..3f174186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.0-alpha +* Depend on Dart 2 and Angel 2. + # 1.1.0+1 * Dart 2/strong mode fixes. * Pass a `useZone` flag to `AngelHttp` through `TestServer`. \ No newline at end of file diff --git a/example/main.dart b/example/main.dart index c5a811a8..1252a544 100644 --- a/example/main.dart +++ b/example/main.dart @@ -11,30 +11,31 @@ main() { setUp(() async { app = new Angel() - ..get('/hello', 'Hello') + ..get('/hello', (req, res) => 'Hello') ..get( '/error', - () => throw new AngelHttpException.forbidden(message: 'Test') + (req, res) => throw new AngelHttpException.forbidden(message: 'Test') ..errors.addAll(['foo', 'bar'])) - ..get('/body', (ResponseContext res) { + ..get('/body', (req, res) { res ..write('OK') - ..end(); + ..close(); }) ..get( '/valid', - () => { + (req, res) => { 'michael': 'jackson', 'billie': {'jean': 'hee-hee', 'is_my_lover': false} }) ..post('/hello', (req, res) async { - return {'bar': req.body['foo']}; + var body = await req.parseBody(); + return {'bar': body['foo']}; }) ..get('/gzip', (req, res) async { res ..headers['content-encoding'] = 'gzip' ..write(gzip.encode('Poop'.codeUnits)) - ..end(); + ..close(); }) ..use( '/foo', diff --git a/pubspec.yaml b/pubspec.yaml index 9ae582f0..454b07b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,18 +2,17 @@ author: Tobe O description: Testing utility library for the Angel framework. homepage: https://github.com/angel-dart/test.git name: angel_test -version: 1.1.0+1 +version: 2.0.0-alpha dependencies: - angel_client: ^1.1.0-alpha - angel_framework: ^1.1.0-alpha - angel_validate: ^1.0.0 - angel_websocket: ^1.1.0-alpha - dart2_constant: ^1.0.0 + angel_client: ^2.0.0-alpha + angel_framework: ^2.0.0-alpha + angel_validate: ^2.0.0-alpha + angel_websocket: ^2.0.0-alpha http: ^0.11.0 matcher: ^0.12.0+2 mock_request: ^1.0.0 web_socket_channel: ^1.0.0 dev_dependencies: - test: ^0.12.17+2 + test: ^1.0.0 environment: - sdk: ">=1.8.9 <3.0.0" + sdk: ">=2.0.0-dev <3.0.0" diff --git a/test/simple_test.dart b/test/simple_test.dart index 2f3e5f11..b934c76b 100644 --- a/test/simple_test.dart +++ b/test/simple_test.dart @@ -12,30 +12,31 @@ main() { setUp(() async { app = new Angel() - ..get('/hello', 'Hello') + ..get('/hello', (req, res) => 'Hello') ..get( '/error', - () => throw new AngelHttpException.forbidden(message: 'Test') + (req, res) => throw new AngelHttpException.forbidden(message: 'Test') ..errors.addAll(['foo', 'bar'])) - ..get('/body', (ResponseContext res) { + ..get('/body', (req, res) { res ..write('OK') - ..end(); + ..close(); }) ..get( '/valid', - () => { + (req, res) => { 'michael': 'jackson', 'billie': {'jean': 'hee-hee', 'is_my_lover': false} }) ..post('/hello', (req, res) async { - return {'bar': req.body['foo']}; + var body = await req.parseBody(); + return {'bar': body['foo']}; }) ..get('/gzip', (req, res) async { res ..headers['content-encoding'] = 'gzip' ..write(gzip.encode('Poop'.codeUnits)) - ..end(); + ..close(); }) ..use( '/foo',