FakeLaneShell class
A LaneShell that runs nothing. It records every call and answers with results you set up.
When asked for output it replays the stubbed output line by line, standard output first.
A command with no stub succeeds with empty output, so a lane that runs many incidental commands only needs stubs for the ones that matter.
- Implemented types
Constructors
- FakeLaneShell()
- Creates a fake shell.
Properties
-
calls
→ List<
ShellCall> -
Every command run so far, in order.
no setter
-
commands
→ List<
String> -
Every command run so far as lines, for example
['flutter build apk'].no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
String executable, List< String> arguments, {String? workingDirectory, Map<String, String> ? environment, void onOutput(String line)?}) → Future<ShellResult> -
Runs
executablewithargumentsand waits for it to finish.override -
stub(
String command, {int exitCode = 0, String stdout = '', String stderr = ''}) → void -
Makes
command(written as one line, for exampleflutter build apk) answer with the given result. A later stub for the same command wins. -
stubMissing(
String executable) → void -
Makes
executablebehave as if it is not installed: running it throws a ProcessException, like the real shell does. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited