2.0.0-alpha.1
This commit is contained in:
parent
d918034dd6
commit
bcac051492
6 changed files with 22 additions and 18 deletions
|
@ -1,3 +1,6 @@
|
|||
# 2.0.0-alpha.1
|
||||
* Update for compliance with newer `angel_client`.
|
||||
|
||||
# 2.0.0-alpha
|
||||
* Depend on Dart 2 and Angel 2.
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'dart:io';
|
||||
import 'package:angel_framework/angel_framework.dart';
|
||||
import 'package:angel_test/angel_test.dart';
|
||||
import 'package:angel_validate/angel_validate.dart';
|
||||
import 'package:angel_websocket/server.dart';
|
||||
import 'package:dart2_constant/io.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() {
|
||||
|
@ -34,7 +34,7 @@ main() {
|
|||
..get('/gzip', (req, res) async {
|
||||
res
|
||||
..headers['content-encoding'] = 'gzip'
|
||||
..write(gzip.encode('Poop'.codeUnits))
|
||||
..add(gzip.encode('Poop'.codeUnits))
|
||||
..close();
|
||||
})
|
||||
..use(
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert' show Encoding;
|
||||
import 'dart:io' show ContentType, Cookie, HttpServer, HttpSession, WebSocket;
|
||||
import 'package:dart2_constant/convert.dart';
|
||||
import 'package:dart2_constant/io.dart' hide WebSocket;
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:angel_client/base_angel_client.dart' as client;
|
||||
import 'package:angel_client/io.dart' as client;
|
||||
import 'package:angel_framework/angel_framework.dart';
|
||||
|
@ -181,22 +179,25 @@ class TestClient extends client.BaseAngelClient {
|
|||
}
|
||||
|
||||
@override
|
||||
Future configure(client.AngelConfigurer configurer) => configurer(this);
|
||||
Future configure(client.AngelConfigurer configurer) =>
|
||||
new Future.sync(() => configurer(this));
|
||||
|
||||
@override
|
||||
client.Service service(String path,
|
||||
{Type type, client.AngelDeserializer deserializer}) {
|
||||
client.Service<Id, Data> service<Id, Data>(String path,
|
||||
{Type type, client.AngelDeserializer<Data> deserializer}) {
|
||||
String uri = path.toString().replaceAll(_straySlashes, "");
|
||||
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;
|
||||
|
||||
_MockService(this._app, String basePath,
|
||||
{client.AngelDeserializer deserializer})
|
||||
{client.AngelDeserializer<Data> deserializer})
|
||||
: super(null, _app, basePath, deserializer: deserializer);
|
||||
|
||||
@override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:angel_http_exception/angel_http_exception.dart';
|
||||
import 'package:angel_validate/angel_validate.dart';
|
||||
import 'package:dart2_constant/convert.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:matcher/matcher.dart';
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
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
|
||||
name: angel_test
|
||||
version: 2.0.0-alpha
|
||||
version: 2.0.0-alpha.1
|
||||
dependencies:
|
||||
angel_client: ^2.0.0-alpha
|
||||
angel_framework: ^2.0.0-alpha
|
||||
angel_http_exception: ^1.0.0
|
||||
angel_validate: ^2.0.0-alpha
|
||||
angel_websocket: ^2.0.0-alpha
|
||||
http: ^0.11.0
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import 'dart:io' show ContentType;
|
||||
import 'dart:io';
|
||||
import 'package:angel_framework/angel_framework.dart';
|
||||
import 'package:angel_test/angel_test.dart';
|
||||
import 'package:angel_validate/angel_validate.dart';
|
||||
import 'package:angel_websocket/server.dart';
|
||||
import 'package:dart2_constant/io.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() {
|
||||
|
@ -35,7 +34,7 @@ main() {
|
|||
..get('/gzip', (req, res) async {
|
||||
res
|
||||
..headers['content-encoding'] = 'gzip'
|
||||
..write(gzip.encode('Poop'.codeUnits))
|
||||
..add(gzip.encode('Poop'.codeUnits))
|
||||
..close();
|
||||
})
|
||||
..use(
|
||||
|
|
Loading…
Reference in a new issue