| Index: test/message_change_test.dart
|
| diff --git a/test/message_change_test.dart b/test/message_change_test.dart
|
| index f77edd126fbca0650cf845a64fdc104120905431..14f8ec2ab2edfa804962fd4c8a961033fe19b813 100644
|
| --- a/test/message_change_test.dart
|
| +++ b/test/message_change_test.dart
|
| @@ -14,23 +14,22 @@ import 'test_util.dart';
|
| void main() {
|
| group('Request', () {
|
| _testChange(({headers, context}) {
|
| - return new Request('GET', LOCALHOST_URI, headers: headers,
|
| - context: context);
|
| + return new Request('GET', LOCALHOST_URI,
|
| + headers: headers, context: context);
|
| });
|
| });
|
|
|
| group('Response', () {
|
| _testChange(({headers, context}) {
|
| - return new Response.ok(null, headers: headers,
|
| - context: context);
|
| + return new Response.ok(null, headers: headers, context: context);
|
| });
|
| });
|
| }
|
|
|
| /// Shared test method used by [Request] and [Response] tests to validate
|
| /// the behavior of `change` with different `headers` and `context` values.
|
| -void _testChange(Message factory({Map<String, String> headers,
|
| - Map<String, Object> context})) {
|
| +void _testChange(Message factory(
|
| + {Map<String, String> headers, Map<String, Object> context})) {
|
| test('with empty headers returns indentical instance', () {
|
| var request = factory(headers: {'header1': 'header value 1'});
|
| var copy = request.change(headers: {});
|
| @@ -46,30 +45,30 @@ void _testChange(Message factory({Map<String, String> headers,
|
| });
|
|
|
| test('new header values are added', () {
|
| - var request = factory(headers: {'test':'test value'});
|
| + var request = factory(headers: {'test': 'test value'});
|
| var copy = request.change(headers: {'test2': 'test2 value'});
|
|
|
| - expect(copy.headers, {'test':'test value', 'test2':'test2 value'});
|
| + expect(copy.headers, {'test': 'test value', 'test2': 'test2 value'});
|
| });
|
|
|
| test('existing header values are overwritten', () {
|
| - var request = factory(headers: {'test':'test value'});
|
| + var request = factory(headers: {'test': 'test value'});
|
| var copy = request.change(headers: {'test': 'new test value'});
|
|
|
| - expect(copy.headers, {'test':'new test value'});
|
| + expect(copy.headers, {'test': 'new test value'});
|
| });
|
|
|
| test('new context values are added', () {
|
| - var request = factory(context: {'test':'test value'});
|
| + var request = factory(context: {'test': 'test value'});
|
| var copy = request.change(context: {'test2': 'test2 value'});
|
|
|
| - expect(copy.context, {'test':'test value', 'test2':'test2 value'});
|
| + expect(copy.context, {'test': 'test value', 'test2': 'test2 value'});
|
| });
|
|
|
| test('existing context values are overwritten', () {
|
| - var request = factory(context: {'test':'test value'});
|
| + var request = factory(context: {'test': 'test value'});
|
| var copy = request.change(context: {'test': 'new test value'});
|
|
|
| - expect(copy.context, {'test':'new test value'});
|
| + expect(copy.context, {'test': 'new test value'});
|
| });
|
| }
|
|
|