mockExec method

void mockExec({
  1. required String result,
  2. GgLog? ggLog,
  3. Directory? directory,
  4. bool doThrow = false,
  5. String? message,
})
inherited

Makes exec successful or not

Implementation

void mockExec({
  required T result,
  GgLog? ggLog,
  Directory? directory,
  bool doThrow = false,
  String? message,
}) {
  when(
    () => exec(
      directory: any(
        named: 'directory',
        that: predicate<Directory>(
          (d) => directory == null || d.path == directory.path,
        ),
      ),
      ggLog: ggLog ?? any(named: 'ggLog'),
    ),
  ).thenAnswer((invocation) async {
    return defaultReaction(
      doThrow: doThrow,
      invocation: invocation,
      result: result,
      message: message,
    );
  });
}