mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 00:42:13 +08:00
[flutter_plugin_tools] Move publish tests to RecordingProcessRunner (#4269)
Replaces almost all of the `TestProcessRunner`, which was specific to the `publish` tests, with the repo-standard `RecordingProcessRunner` (which now has most of the capabilities these tests need). This finishes aligning these tests with the rest of the repository tests, so they will be easier to maintain as part of the overall repository. To support this, `RecordingProcessRunner` was modified slightly to return a succeeding, no-output process by default for `start`. That makes it consistent with its existing `run` behavior, so is a good change in general.
This commit is contained in:
@ -17,6 +17,8 @@ import 'package:path/path.dart' as p;
|
||||
import 'package:platform/platform.dart';
|
||||
import 'package:quiver/collection.dart';
|
||||
|
||||
import 'mocks.dart';
|
||||
|
||||
/// Returns the exe name that command will use when running Flutter on
|
||||
/// [platform].
|
||||
String getFlutterCommand(Platform platform) =>
|
||||
@ -320,7 +322,8 @@ class RecordingProcessRunner extends ProcessRunner {
|
||||
Future<io.Process> start(String executable, List<String> args,
|
||||
{Directory? workingDirectory}) async {
|
||||
recordedCalls.add(ProcessCall(executable, args, workingDirectory?.path));
|
||||
return Future<io.Process>.value(_getProcessToReturn(executable));
|
||||
return Future<io.Process>.value(
|
||||
_getProcessToReturn(executable) ?? MockProcess());
|
||||
}
|
||||
|
||||
io.Process? _getProcessToReturn(String executable) {
|
||||
|
Reference in New Issue
Block a user