fix pub usage in tests (dart-lang/pubspec_parse#81)
diff --git a/pkgs/pubspec_parse/test/pub_utils.dart b/pkgs/pubspec_parse/test/pub_utils.dart index 5871b1b..a60aa2a 100644 --- a/pkgs/pubspec_parse/test/pub_utils.dart +++ b/pkgs/pubspec_parse/test/pub_utils.dart
@@ -14,8 +14,8 @@ await d.file('pubspec.yaml', content).create(); final proc = await TestProcess.start( - _pubPath, - ['get', '--offline'], + Platform.resolvedExecutable, + ['pub', 'get', '--offline'], workingDirectory: d.sandbox, // Don't pass current process VM options to child environment: Map.from(Platform.environment)..remove('DART_VM_OPTIONS'), @@ -86,15 +86,3 @@ @override String toString() => '${isError ? 'err' : 'out'} $line'; } - -/// The path to the root directory of the SDK. -final String _sdkDir = () { - // The Dart executable is in "/path/to/sdk/bin/dart", so two levels up is - // "/path/to/sdk". - final aboveExecutable = p.dirname(p.dirname(Platform.resolvedExecutable)); - assert(FileSystemEntity.isFileSync(p.join(aboveExecutable, 'version'))); - return aboveExecutable; -}(); - -final String _pubPath = - p.join(_sdkDir, 'bin', Platform.isWindows ? 'pub.bat' : 'pub');