run method

  1. @override
Future<CommandResult> run(
  1. String command, {
  2. List<String> arguments = const [],
  3. String? workingDirectory,
  4. Duration? timeout,
})
override

Runs command with arguments and returns stdout/stderr/exit code.

When timeout elapses the process is killed and a TimeoutException is thrown.

Implementation

@override
Future<CommandResult> run(
  String command, {
  List<String> arguments = const [],
  String? workingDirectory,
  Duration? timeout,
}) async {
  calls.add(
    FakeCommandCall(
      command: command,
      arguments: List.unmodifiable(arguments),
      workingDirectory: workingDirectory,
      timeout: timeout,
    ),
  );
  return handler(command, arguments) ??
      const CommandResult(stdout: '', stderr: '', exitCode: 1);
}