expectExitCode method

Future expectExitCode(
  1. Iterable<int> acceptedCodes
)

Implementation

Future expectExitCode(Iterable<int> acceptedCodes) async {
  var code = await exitCode;

  if (!acceptedCodes.contains(code))
    throw new StateError(
        '$invocation terminated with unexpected exit code $code.');
  else
    await stderr.drain();
}