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 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:scheduled_test/scheduled_stream.dart'; | 9 import 'package:scheduled_test/scheduled_stream.dart'; |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 }))); | 34 }))); |
35 }); | 35 }); |
36 } | 36 } |
37 } | 37 } |
38 """; | 38 """; |
39 | 39 |
40 main() { | 40 main() { |
41 initConfig(); | 41 initConfig(); |
42 withBarbackVersions("any", () { | 42 withBarbackVersions("any", () { |
43 integration("AssetNotFoundExceptions are detectable", () { | 43 integration("AssetNotFoundExceptions are detectable", () { |
44 d.dir(appPath, [ | 44 d.dir(appPath, [d.pubspec({ |
45 d.pubspec({ | |
46 "name": "myapp", | 45 "name": "myapp", |
47 "transformers": ["myapp/src/transformer"] | 46 "transformers": ["myapp/src/transformer"] |
48 }), | 47 }), |
49 d.dir("lib", [d.dir("src", [ | 48 d.dir("lib", [d.dir("src", [d.file("transformer.dart", transformer)]
)]), |
50 d.file("transformer.dart", transformer) | 49 d.dir("web", [d.file("foo.txt", "foo")])]).create(); |
51 ])]), | |
52 d.dir("web", [ | |
53 d.file("foo.txt", "foo") | |
54 ]) | |
55 ]).create(); | |
56 | 50 |
57 createLockFile('myapp', pkg: ['barback']); | 51 createLockFile('myapp', pkg: ['barback']); |
58 | 52 |
59 var server = pubServe(); | 53 var server = pubServe(); |
60 requestShouldSucceed("foo.txt", JSON.encode({ | 54 requestShouldSucceed("foo.txt", JSON.encode({ |
61 "package": "myapp", | 55 "package": "myapp", |
62 "path": "nonexistent" | 56 "path": "nonexistent" |
63 })); | 57 })); |
64 endPubServe(); | 58 endPubServe(); |
65 | 59 |
66 // Since the AssetNotFoundException was caught and handled, the server | 60 // Since the AssetNotFoundException was caught and handled, the server |
67 // shouldn't print any error information for it. | 61 // shouldn't print any error information for it. |
68 server.stderr.expect(isDone); | 62 server.stderr.expect(isDone); |
69 }); | 63 }); |
70 }); | 64 }); |
71 } | 65 } |
OLD | NEW |