Index: pkg/shelf/test/request_test.dart |
diff --git a/pkg/shelf/test/request_test.dart b/pkg/shelf/test/request_test.dart |
index ce592c7c28a85eeaec4f5d1be66abb2c456e16c2..e4c2c4ba6f13b7d61bbc6f96ca6d8bb9717b923c 100644 |
--- a/pkg/shelf/test/request_test.dart |
+++ b/pkg/shelf/test/request_test.dart |
@@ -10,10 +10,11 @@ import 'dart:convert'; |
import 'package:shelf/shelf.dart'; |
import 'package:unittest/unittest.dart'; |
-Request _request([Map<String, String> headers, Stream<List<int>> body]) { |
+Request _request([Map<String, String> headers, Stream<List<int>> body, |
+ Map<String, Object> context]) { |
if (headers == null) headers = {}; |
return new Request("/", "", "GET", "", "1.1", Uri.parse('http://localhost/'), |
- headers, body: body); |
+ headers, body: body, context: context); |
} |
void main() { |
@@ -147,4 +148,14 @@ void main() { |
}).encoding, equals(LATIN1)); |
}); |
}); |
+ |
+ group("context", () { |
+ test("are correctly populated", () { |
+ expect(_request({ |
+ 'content-type': 'text/plain' |
+ }, null, { |
+ 'my-param' : 42 |
+ }).context['my-param'], equals(42)); |
+ }); |
+ }); |
} |