OLD | NEW |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library pub_tests; | 1 library pub_tests; |
6 | |
7 import 'package:scheduled_test/scheduled_test.dart'; | 2 import 'package:scheduled_test/scheduled_test.dart'; |
8 | |
9 import '../../descriptor.dart' as d; | 3 import '../../descriptor.dart' as d; |
10 import '../../test_pub.dart'; | 4 import '../../test_pub.dart'; |
11 import '../utils.dart'; | 5 import '../utils.dart'; |
12 | |
13 main() { | 6 main() { |
14 initConfig(); | 7 initConfig(); |
15 setUp(() { | 8 setUp(() { |
16 d.dir(appPath, [ | 9 d.dir(appPath, [d.appPubspec()]).create(); |
17 d.appPubspec() | |
18 ]).create(); | |
19 }); | 10 }); |
20 | |
21 integration("responds with NOT_SERVED for an unknown domain", () { | 11 integration("responds with NOT_SERVED for an unknown domain", () { |
22 pubServe(); | 12 pubServe(); |
23 expectWebSocketError("urlToAssetId", { | 13 expectWebSocketError("urlToAssetId", { |
24 "url": "http://example.com:80/index.html" | 14 "url": "http://example.com:80/index.html" |
25 }, NOT_SERVED, '"example.com:80" is not being served by pub.'); | 15 }, NOT_SERVED, '"example.com:80" is not being served by pub.'); |
26 endPubServe(); | 16 endPubServe(); |
27 }); | 17 }); |
28 | |
29 integration("responds with NOT_SERVED for an unknown port", () { | 18 integration("responds with NOT_SERVED for an unknown port", () { |
30 pubServe(); | 19 pubServe(); |
31 expectWebSocketError("urlToAssetId", { | 20 expectWebSocketError("urlToAssetId", { |
32 "url": "http://localhost:80/index.html" | 21 "url": "http://localhost:80/index.html" |
33 }, NOT_SERVED, '"localhost:80" is not being served by pub.'); | 22 }, NOT_SERVED, '"localhost:80" is not being served by pub.'); |
34 endPubServe(); | 23 endPubServe(); |
35 }); | 24 }); |
36 } | 25 } |
OLD | NEW |