| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 scheduled_server_test; | 5 library scheduled_server_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | |
| 9 | 8 |
| 10 import 'package:http/http.dart' as http; | 9 import 'package:http/http.dart' as http; |
| 11 import 'package:scheduled_test/scheduled_server.dart'; | 10 import 'package:scheduled_test/scheduled_server.dart'; |
| 12 import 'package:scheduled_test/scheduled_test.dart'; | 11 import 'package:scheduled_test/scheduled_test.dart'; |
| 13 import 'package:shelf/shelf.dart' as shelf; | 12 import 'package:shelf/shelf.dart' as shelf; |
| 14 | 13 |
| 15 import 'package:metatest/metatest.dart'; | |
| 16 import 'utils.dart'; | 14 import 'utils.dart'; |
| 17 | 15 |
| 18 void main() { | 16 void main() { |
| 19 expectTestPasses("a server with no handlers does nothing", () { | 17 expectTestPasses("a server with no handlers does nothing", () { |
| 20 new ScheduledServer(); | 18 new ScheduledServer(); |
| 21 }); | 19 }); |
| 22 | 20 |
| 23 expectServerError("a server with no handlers that receives a request throws " | 21 expectServerError("a server with no handlers that receives a request throws " |
| 24 "an error", () { | 22 "an error", () { |
| 25 var server = new ScheduledServer(); | 23 var server = new ScheduledServer(); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // (because it's given an ad-hoc stack trace). | 174 // (because it's given an ad-hoc stack trace). |
| 177 expect(errors.length, inInclusiveRange(1, 3)); | 175 expect(errors.length, inInclusiveRange(1, 3)); |
| 178 expect(errors[0].error.toString(), errorMessage); | 176 expect(errors[0].error.toString(), errorMessage); |
| 179 | 177 |
| 180 for (var i = 1; i < errors.length; i++) { | 178 for (var i = 1; i < errors.length; i++) { |
| 181 if (errors[i].error == errors[0].error) continue; | 179 if (errors[i].error == errors[0].error) continue; |
| 182 expect(errors[i].error, new isInstanceOf<http.ClientException>()); | 180 expect(errors[i].error, new isInstanceOf<http.ClientException>()); |
| 183 } | 181 } |
| 184 }); | 182 }); |
| 185 } | 183 } |
| OLD | NEW |