OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library shelf.request_test; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 import 'dart:convert'; | 6 import 'dart:convert'; |
9 | 7 |
10 import 'package:shelf/shelf.dart'; | 8 import 'package:shelf/shelf.dart'; |
11 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
12 | 10 |
13 import 'test_util.dart'; | 11 import 'test_util.dart'; |
14 | 12 |
15 Request _request({Map<String, String> headers, body, Encoding encoding}) { | 13 Request _request({Map<String, String> headers, body, Encoding encoding}) { |
16 return new Request("GET", LOCALHOST_URI, | 14 return new Request("GET", LOCALHOST_URI, |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 var request = _request(); | 297 var request = _request(); |
300 var changed1 = request.change(); | 298 var changed1 = request.change(); |
301 var changed2 = request.change(); | 299 var changed2 = request.change(); |
302 | 300 |
303 expect(changed2.read().toList(), completion(isEmpty)); | 301 expect(changed2.read().toList(), completion(isEmpty)); |
304 expect(changed1.read, throwsStateError); | 302 expect(changed1.read, throwsStateError); |
305 expect(request.read, throwsStateError); | 303 expect(request.read, throwsStateError); |
306 }); | 304 }); |
307 }); | 305 }); |
308 } | 306 } |
OLD | NEW |