| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
| 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; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 Future apply(Transform transform) { | 23 Future apply(Transform transform) { |
| 24 return transform.primaryInput.readAsString().then((contents) { | 24 return transform.primaryInput.readAsString().then((contents) { |
| 25 transform.addOutput(new Asset.fromString(transform.primaryInput.id, | 25 transform.addOutput(new Asset.fromString(transform.primaryInput.id, |
| 26 contents.replaceAll("REPLACE ME", "hello!"))); | 26 contents.replaceAll("REPLACE ME", "hello!"))); |
| 27 }); | 27 }); |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 """; | 30 """; |
| 31 | 31 |
| 32 main() { | 32 main() { |
| 33 initConfig(); | |
| 34 integration("snapshots the transformed version of an executable", () { | 33 integration("snapshots the transformed version of an executable", () { |
| 35 servePackages((builder) { | 34 servePackages((builder) { |
| 36 builder.serveRepoPackage('barback'); | 35 builder.serveRepoPackage('barback'); |
| 37 | 36 |
| 38 builder.serve("foo", "1.2.3", | 37 builder.serve("foo", "1.2.3", |
| 39 deps: {"barback": "any"}, | 38 deps: {"barback": "any"}, |
| 40 pubspec: {'transformers': ['foo']}, | 39 pubspec: {'transformers': ['foo']}, |
| 41 contents: [ | 40 contents: [ |
| 42 d.dir("lib", [d.file("foo.dart", REPLACE_TRANSFORMER)]), | 41 d.dir("lib", [d.file("foo.dart", REPLACE_TRANSFORMER)]), |
| 43 d.dir("bin", [ | 42 d.dir("bin", [ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 56 | 55 |
| 57 d.dir(p.join(appPath, '.pub', 'bin'), [ | 56 d.dir(p.join(appPath, '.pub', 'bin'), [ |
| 58 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) | 57 d.dir('foo', [d.matcherFile('hello.dart.snapshot', contains('hello!'))]) |
| 59 ]).validate(); | 58 ]).validate(); |
| 60 | 59 |
| 61 var process = pubRun(args: ['foo:hello']); | 60 var process = pubRun(args: ['foo:hello']); |
| 62 process.stdout.expect("hello!"); | 61 process.stdout.expect("hello!"); |
| 63 process.shouldExit(); | 62 process.shouldExit(); |
| 64 }); | 63 }); |
| 65 } | 64 } |
| OLD | NEW |