From 6b1595ec72eb7e38cb54ca3040d3dc11468d89de Mon Sep 17 00:00:00 2001 From: "rnystrom@google.com" <rnystrom@google.com> Date: Thu, 25 Sep 2014 02:54:59 +0000 Subject: [PATCH] Fix path warning test. TBR. Review URL: https://codereview.chromium.org//600313002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@40666 260f80e4-7a28-3924-810f-c04153c831b5 --- lib/src/global_packages.dart | 7 ++++--- ..._if_not_on_path.dart => warns_if_not_on_path_test.dart} | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) rename test/global/binstubs/{warns_if_not_on_path.dart => warns_if_not_on_path_test.dart} (89%) diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart index de1cf148..0f87dc0f 100644 --- a/lib/src/global_packages.dart +++ b/lib/src/global_packages.dart @@ -624,7 +624,7 @@ $invocation "\$@" if (Platform.operatingSystem == "windows") { // See if the shell can find one of the binstubs. // "\q" means return exit code 0 if found or 1 if not. - var result = Process.runSync("where", [r"\q", installed.first]); + var result = runProcessSync("where", [r"\q", installed.first]); if (result.exitCode == 0) return; var binDir = _binStubDir; @@ -641,7 +641,7 @@ $invocation "\$@" 'A web search for "configure windows path" will show you how.'); } else { // See if the shell can find one of the binstubs. - var result = Process.runSync("which", [installed.first]); + var result = runProcessSync("which", [installed.first]); if (result.exitCode == 0) return; var binDir = _binStubDir; @@ -656,7 +656,8 @@ $invocation "\$@" "You can fix that by adding this to your shell's config file " "(.bashrc, .bash_profile, etc.):\n" "\n" - "\n${log.bold('export PATH="\$PATH":"$binDir"')}\n"); + " ${log.bold('export PATH="\$PATH":"$binDir"')}\n" + "\n"); } } } diff --git a/test/global/binstubs/warns_if_not_on_path.dart b/test/global/binstubs/warns_if_not_on_path_test.dart similarity index 89% rename from test/global/binstubs/warns_if_not_on_path.dart rename to test/global/binstubs/warns_if_not_on_path_test.dart index 8ea5d2e3..ec3fedb5 100644 --- a/test/global/binstubs/warns_if_not_on_path.dart +++ b/test/global/binstubs/warns_if_not_on_path_test.dart @@ -13,7 +13,7 @@ main() { servePackages((builder) { builder.serve("foo", "1.0.0", pubspec: { "executables": { - "script": null + "some-dart-script": "script" } }, contents: [ d.dir("bin", [ @@ -23,6 +23,6 @@ main() { }); schedulePub(args: ["global", "activate", "foo"], - output: contains("is not on your path")); + error: contains("is not on your path")); }); } -- GitLab