OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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 pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:json_rpc_2/error_code.dart' as rpc_error_code; | 7 import 'package:json_rpc_2/error_code.dart' as rpc_error_code; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../../descriptor.dart' as d; | 10 import '../../descriptor.dart' as d; |
11 import '../../test_pub.dart'; | 11 import '../../test_pub.dart'; |
12 import '../utils.dart'; | 12 import '../utils.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 initConfig(); | |
16 | |
17 setUp(() { | 15 setUp(() { |
18 d.dir(appPath, [ | 16 d.dir(appPath, [ |
19 d.appPubspec(), | 17 d.appPubspec(), |
20 d.dir("web", [ | 18 d.dir("web", [ |
21 d.file("index.html", "<body>") | 19 d.file("index.html", "<body>") |
22 ]) | 20 ]) |
23 ]).create(); | 21 ]).create(); |
24 }); | 22 }); |
25 | 23 |
26 integration("responds with an error if 'path' is not a string", () { | 24 integration("responds with an error if 'path' is not a string", () { |
(...skipping 15 matching lines...) Expand all Loading... |
42 | 40 |
43 integration("responds with an error if 'path' reaches out", () { | 41 integration("responds with an error if 'path' reaches out", () { |
44 pubServe(); | 42 pubServe(); |
45 expectWebSocketError("serveDirectory", {"path": "a/../../bad.txt"}, | 43 expectWebSocketError("serveDirectory", {"path": "a/../../bad.txt"}, |
46 rpc_error_code.INVALID_PARAMS, | 44 rpc_error_code.INVALID_PARAMS, |
47 '"path" cannot reach out of its containing directory. Got ' | 45 '"path" cannot reach out of its containing directory. Got ' |
48 '"a/../../bad.txt".'); | 46 '"a/../../bad.txt".'); |
49 endPubServe(); | 47 endPubServe(); |
50 }); | 48 }); |
51 } | 49 } |
OLD | NEW |