From 6128daf5d6f14161438dbaa321a93252125b1e61 Mon Sep 17 00:00:00 2001 From: thosakwe Date: Tue, 28 Mar 2017 22:00:25 -0400 Subject: [PATCH] 1.0.3 --- README.md | 2 +- lib/src/client.dart | 15 ++++++++------- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7e78be74..3d21b948 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # angel_test -[![version 1.0.2](https://img.shields.io/badge/pub-1.0.2-brightgreen.svg)](https://pub.dartlang.org/packages/angel_test) +[![version 1.0.3](https://img.shields.io/badge/pub-1.0.3-brightgreen.svg)](https://pub.dartlang.org/packages/angel_test) [![build status](https://travis-ci.org/angel-dart/test.svg)](https://travis-ci.org/angel-dart/test) Testing utility library for the Angel framework. diff --git a/lib/src/client.dart b/lib/src/client.dart index a0023b6c..c71d2cad 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:angel_client/angel_client.dart' show AngelAuthResult; 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'; @@ -28,7 +27,7 @@ Future connectTo(Angel app, {Map initialSession}) async => /// An `angel_client` that sends mock requests to a server, rather than actual HTTP transactions. class TestClient extends client.BaseAngelClient { - final Map _services = {}; + final Map _services = {}; /// Session info to be sent to the server on every request. final HttpSession session = new MockHttpSession(id: 'angel-test-client'); @@ -157,15 +156,17 @@ class TestClient extends client.BaseAngelClient { client.Service service(String path, {Type type, client.AngelDeserializer deserializer}) { String uri = path.toString().replaceAll(_straySlashes, ""); - return _services.putIfAbsent(uri, - new MockService(this, '$basePath/$uri', deserializer: deserializer)); + return _services.putIfAbsent( + uri, + () => new _MockService(this, '$basePath/$uri', + deserializer: deserializer)); } } -class MockService extends client.BaseAngelService { +class _MockService extends client.BaseAngelService { final TestClient _app; - MockService(this._app, String basePath, + _MockService(this._app, String basePath, {client.AngelDeserializer deserializer}) : super(null, _app, basePath, deserializer: deserializer); @@ -176,7 +177,7 @@ class MockService extends client.BaseAngelService { } return _app.send(request.method, request.url, request.headers, - request.finalize(), request); + request.finalize()); } } diff --git a/pubspec.yaml b/pubspec.yaml index 951b14ff..fd430aa2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: "Tobe O " description: "Testing utility library for the Angel framework." homepage: "https://github.com/angel-dart/test.git" name: "angel_test" -version: "1.0.2" +version: "1.0.3" dependencies: angel_client: "^1.0.0" angel_framework: "^1.0.0-dev"