| 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 '../../descriptor.dart' as d; | 7 import '../../descriptor.dart' as d; |
| 8 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
| 9 import '../../serve/utils.dart'; | 9 import '../../serve/utils.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 integration("includes assets", () { | 12 integration("includes assets", () { |
| 13 serveBarback(); |
| 14 |
| 13 d.dir(appPath, [ | 15 d.dir(appPath, [ |
| 14 d.pubspec({ | 16 d.pubspec({ |
| 15 "name": "myapp", | 17 "name": "myapp", |
| 16 "transformers": [ | 18 "transformers": [ |
| 17 { | 19 { |
| 18 "myapp/src/transformer": { | 20 "myapp/src/transformer": { |
| 19 "\$include": [ | 21 "\$include": [ |
| 20 "web/foo.txt", | 22 "web/foo.txt", |
| 21 "web/sub/foo.txt" | 23 "web/sub/foo.txt" |
| 22 ] | 24 ] |
| 23 } | 25 } |
| 24 } | 26 } |
| 25 ] | 27 ], |
| 28 "dependencies": {"barback": "any"} |
| 26 }), | 29 }), |
| 27 d.dir("lib", [d.dir("src", [ | 30 d.dir("lib", [d.dir("src", [ |
| 28 d.file("transformer.dart", REWRITE_TRANSFORMER) | 31 d.file("transformer.dart", REWRITE_TRANSFORMER) |
| 29 ])]), | 32 ])]), |
| 30 d.dir("web", [ | 33 d.dir("web", [ |
| 31 d.file("foo.txt", "foo"), | 34 d.file("foo.txt", "foo"), |
| 32 d.file("bar.txt", "bar"), | 35 d.file("bar.txt", "bar"), |
| 33 d.dir("sub", [ | 36 d.dir("sub", [ |
| 34 d.file("foo.txt", "foo"), | 37 d.file("foo.txt", "foo"), |
| 35 ]) | 38 ]) |
| 36 ]) | 39 ]) |
| 37 ]).create(); | 40 ]).create(); |
| 38 | 41 |
| 39 createLockFile('myapp', pkg: ['barback']); | 42 pubGet(); |
| 40 | |
| 41 pubServe(); | 43 pubServe(); |
| 42 requestShouldSucceed("foo.out", "foo.out"); | 44 requestShouldSucceed("foo.out", "foo.out"); |
| 43 requestShouldSucceed("sub/foo.out", "foo.out"); | 45 requestShouldSucceed("sub/foo.out", "foo.out"); |
| 44 requestShould404("bar.out"); | 46 requestShould404("bar.out"); |
| 45 endPubServe(); | 47 endPubServe(); |
| 46 }); | 48 }); |
| 47 } | 49 } |
| OLD | NEW |