| Index: sdk/lib/_internal/pub/test/global/run/runs_transformer_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/run/runs_a_generated_script_test.dart b/sdk/lib/_internal/pub/test/global/run/runs_transformer_test.dart
|
| similarity index 64%
|
| copy from sdk/lib/_internal/pub/test/run/runs_a_generated_script_test.dart
|
| copy to sdk/lib/_internal/pub/test/global/run/runs_transformer_test.dart
|
| index daedf2567873e462f16c90f5f8020a0ae9cb2585..79a181c67500e7c666bd6cc0c3b4134edf14b524 100644
|
| --- a/sdk/lib/_internal/pub/test/run/runs_a_generated_script_test.dart
|
| +++ b/sdk/lib/_internal/pub/test/global/run/runs_transformer_test.dart
|
| @@ -2,9 +2,8 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -import '../descriptor.dart' as d;
|
| -import '../test_pub.dart';
|
| -import 'utils.dart';
|
| +import '../../descriptor.dart' as d;
|
| +import '../../test_pub.dart';
|
|
|
| const TRANSFORMER = """
|
| import 'dart:async';
|
| @@ -18,7 +17,7 @@ class DartTransformer extends Transformer {
|
|
|
| void apply(Transform transform) {
|
| transform.addOutput(new Asset.fromString(
|
| - new AssetId("myapp", "bin/script.dart"),
|
| + new AssetId("foo", "bin/script.dart"),
|
| "void main() => print('generated');"));
|
| }
|
| }
|
| @@ -27,22 +26,20 @@ class DartTransformer extends Transformer {
|
| main() {
|
| initConfig();
|
| withBarbackVersions("any", () {
|
| - integration('runs a script generated from scratch by a transformer', () {
|
| - d.dir(appPath, [
|
| + integration('runs a global script generated by a transformer', () {
|
| + makeGlobalPackage("foo", "1.0.0", [
|
| d.pubspec({
|
| - "name": "myapp",
|
| - "transformers": ["myapp/src/transformer"]
|
| + "name": "foo",
|
| + "version": "1.0.0",
|
| + "transformers": ["foo/src/transformer"]
|
| }),
|
| d.dir("lib", [d.dir("src", [
|
| d.file("transformer.dart", TRANSFORMER),
|
| d.file("primary.in", "")
|
| ])])
|
| - ]).create();
|
| + ], pkg: ['barback']);
|
|
|
| - createLockFile('myapp', pkg: ['barback']);
|
| -
|
| - var pub = pubRun(args: ["script"],
|
| - transformers: ["myapp/src/transformer"]);
|
| + var pub = pubRun(global: true, args: ["foo", "script"]);
|
|
|
| pub.stdout.expect("generated");
|
| pub.shouldExit();
|
|
|