stub method

void stub(
  1. String command, {
  2. int exitCode = 0,
  3. String stdout = '',
  4. String stderr = '',
})

Makes command (written as one line, for example flutter build apk) answer with the given result. A later stub for the same command wins.

Implementation

void stub(
  String command, {
  int exitCode = 0,
  String stdout = '',
  String stderr = '',
}) {
  _stubs[command] = ShellResult(
    exitCode: exitCode,
    stdout: stdout,
    stderr: stderr,
  );
}