Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(687)

Unified Diff: sdk/lib/_internal/pub/test/global/run/runs_transformer_test.dart

Issue 354763006: Add a "pub global run" command. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise! Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698