FakeProcessManager class

A mock that can be used to fake a process manager that runs commands and returns results.

Call setResults to provide a list of results that will return from each command line (with arguments).

Call verifyCalls to verify that each desired call occurred.

Inheritance
Implemented types

Constructors

FakeProcessManager({StringReceivedCallback stdinResults, bool isPeriodic: false})

Properties

calls List<Call>
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
invocations List<Invocation>
The list of invocations that occurred, in the order they occurred.
read / write
isPeriodic bool
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stdinResults StringReceivedCallback
The callback that will be called each time stdin input is supplied to a call.
final

Methods

canRun(dynamic executable, {String workingDirectory}) bool
Returns true if the executable exists and if it can be executed.
inherited
killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) bool
Kills the process with id pid. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
@visibleForTesting, inherited
run(List command, {String workingDirectory, Map<String, String> environment, bool includeParentEnvironment: true, bool runInShell: false, Encoding stdoutEncoding: systemEncoding, Encoding stderrEncoding: systemEncoding}) Future<ProcessResult>
Starts a process and runs it non-interactively to completion. [...]
inherited
runSync(List command, {String workingDirectory, Map<String, String> environment, bool includeParentEnvironment: true, bool runInShell: false, Encoding stdoutEncoding: systemEncoding, Encoding stderrEncoding: systemEncoding}) ProcessResult
Starts a process and runs it to completion. This is a synchronous call and will block until the child process terminates. [...]
inherited
start(List command, {String workingDirectory, Map<String, String> environment, bool includeParentEnvironment: true, bool runInShell: false, ProcessStartMode mode: ProcessStartMode.normal}) Future<Process>
Starts a process by running the specified command. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
verifyCalls() → void
Verify that the given command lines were called, in the given order, and that the parameters were in the same order.

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited