run method
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);
}