class

Fluxion::Executor::FakeShellRunner

Inherits Fluxion::Executor::ShellRunner < Reference < Object

A runner that records what it was asked to do and replays canned results.

This is what lets the module executors be tested exhaustively: their real contract is the argv they build and how they read a result, and both are observable here without a package manager in sight.

Constructors

Instance methods

argv

Every argv seen, joined, for concise assertions.

Source
available(*names : String) : self
Source
command_exists?(name : String) : Bool

Whether the command exists and can be executed at all.

Source
commands
Source
default(result : ProcessResult) : self
Source
on(matching : String, result : ProcessResult) : self

Queues a result for any command whose argv joins to a string containing matching.

Source
on(matching : String, exit_code : Int32, stdout : String = "") : self
Source
output

Output lines to emit for a matching command, keyed the same way.

Source
output=(output : Hash(String, Array(String)))

Output lines to emit for a matching command, keyed the same way.

Source
ran?(matching : String) : Bool
Source
run(command : Command, &sink : String -> ) : ProcessResult

Runs command, yielding each output line as it arrives.

Source