Mix.Shell.Process
This is a Mix shell that uses the current process mailbox for communication instead of IO.
When a developer calls info("hello"), the following
message will be sent to the current process:
{ :mix_shell, :info, ["hello"] }
This is mainly useful in tests, allowing us to assert
if given messages were received or not. Since we need
to guarantee a clean slate between tests, there
is also a flush/1 function responsible for flushing all
:mix_shell related messages from the process inbox.
Summary
| cmd(command) | Executes the given command and fowards its messages to the current process |
| error(message) | Forwards the message to the current process |
| flush(callback \\ fn x -> x end) | Flush all |
| info(message) | Forwards the message to the current process |
| yes?(message) | Forwards the message to the current process. It also checks the inbox for an input message matching: |