2.0.0-alpha.1

This commit is contained in:
Tobe O 2018-10-21 04:22:41 -04:00
parent d918034dd6
commit bcac051492
6 changed files with 22 additions and 18 deletions

View file

@ -1,3 +1,6 @@
# 2.0.0-alpha.1
* Update for compliance with newer `angel_client`.
# 2.0.0-alpha # 2.0.0-alpha
* Depend on Dart 2 and Angel 2. * Depend on Dart 2 and Angel 2.

View file

@ -1,8 +1,8 @@
import 'dart:io';
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
import 'package:angel_test/angel_test.dart'; import 'package:angel_test/angel_test.dart';
import 'package:angel_validate/angel_validate.dart'; import 'package:angel_validate/angel_validate.dart';
import 'package:angel_websocket/server.dart'; import 'package:angel_websocket/server.dart';
import 'package:dart2_constant/io.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
main() { main() {
@ -34,7 +34,7 @@ main() {
..get('/gzip', (req, res) async { ..get('/gzip', (req, res) async {
res res
..headers['content-encoding'] = 'gzip' ..headers['content-encoding'] = 'gzip'
..write(gzip.encode('Poop'.codeUnits)) ..add(gzip.encode('Poop'.codeUnits))
..close(); ..close();
}) })
..use( ..use(

View file

@ -1,8 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert' show Encoding; import 'dart:convert';
import 'dart:io' show ContentType, Cookie, HttpServer, HttpSession, WebSocket; import 'dart:io';
import 'package:dart2_constant/convert.dart';
import 'package:dart2_constant/io.dart' hide WebSocket;
import 'package:angel_client/base_angel_client.dart' as client; import 'package:angel_client/base_angel_client.dart' as client;
import 'package:angel_client/io.dart' as client; import 'package:angel_client/io.dart' as client;
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
@ -181,22 +179,25 @@ class TestClient extends client.BaseAngelClient {
} }
@override @override
Future configure(client.AngelConfigurer configurer) => configurer(this); Future configure(client.AngelConfigurer configurer) =>
new Future.sync(() => configurer(this));
@override @override
client.Service service(String path, client.Service<Id, Data> service<Id, Data>(String path,
{Type type, client.AngelDeserializer deserializer}) { {Type type, client.AngelDeserializer<Data> deserializer}) {
String uri = path.toString().replaceAll(_straySlashes, ""); String uri = path.toString().replaceAll(_straySlashes, "");
return _services.putIfAbsent( return _services.putIfAbsent(
uri, () => new _MockService(this, uri, deserializer: deserializer)); uri,
() => new _MockService<Id, Data>(this, uri,
deserializer: deserializer)) as client.Service<Id, Data>;
} }
} }
class _MockService extends client.BaseAngelService { class _MockService<Id, Data> extends client.BaseAngelService<Id, Data> {
final TestClient _app; final TestClient _app;
_MockService(this._app, String basePath, _MockService(this._app, String basePath,
{client.AngelDeserializer deserializer}) {client.AngelDeserializer<Data> deserializer})
: super(null, _app, basePath, deserializer: deserializer); : super(null, _app, basePath, deserializer: deserializer);
@override @override

View file

@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:angel_http_exception/angel_http_exception.dart'; import 'package:angel_http_exception/angel_http_exception.dart';
import 'package:angel_validate/angel_validate.dart'; import 'package:angel_validate/angel_validate.dart';
import 'package:dart2_constant/convert.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:matcher/matcher.dart'; import 'package:matcher/matcher.dart';

View file

@ -1,11 +1,12 @@
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
description: Testing utility library for the Angel framework. description: Testing utility library for the Angel framework. Use with package:test.
homepage: https://github.com/angel-dart/test.git homepage: https://github.com/angel-dart/test.git
name: angel_test name: angel_test
version: 2.0.0-alpha version: 2.0.0-alpha.1
dependencies: dependencies:
angel_client: ^2.0.0-alpha angel_client: ^2.0.0-alpha
angel_framework: ^2.0.0-alpha angel_framework: ^2.0.0-alpha
angel_http_exception: ^1.0.0
angel_validate: ^2.0.0-alpha angel_validate: ^2.0.0-alpha
angel_websocket: ^2.0.0-alpha angel_websocket: ^2.0.0-alpha
http: ^0.11.0 http: ^0.11.0

View file

@ -1,9 +1,8 @@
import 'dart:io' show ContentType; import 'dart:io';
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
import 'package:angel_test/angel_test.dart'; import 'package:angel_test/angel_test.dart';
import 'package:angel_validate/angel_validate.dart'; import 'package:angel_validate/angel_validate.dart';
import 'package:angel_websocket/server.dart'; import 'package:angel_websocket/server.dart';
import 'package:dart2_constant/io.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
main() { main() {
@ -35,7 +34,7 @@ main() {
..get('/gzip', (req, res) async { ..get('/gzip', (req, res) async {
res res
..headers['content-encoding'] = 'gzip' ..headers['content-encoding'] = 'gzip'
..write(gzip.encode('Poop'.codeUnits)) ..add(gzip.encode('Poop'.codeUnits))
..close(); ..close();
}) })
..use( ..use(