Cheer.Test (Cheer v0.1.5)

Copy Markdown View Source

In-process test runner for CLI commands.

Invokes a command capturing stdout and return value, without spawning a subprocess.

Usage

result = Cheer.Test.run(MyCommand, ["--port", "8080"])
assert result.return == {:ok, %{port: 8080}}
assert result.output == ""

Summary

Functions

Run a command with the given argv, capturing output and return value.

Types

t()

@type t() :: %Cheer.Test{output: String.t(), return: term()}

Functions

run(command, argv, opts \\ [])

@spec run(module(), [String.t()], keyword()) :: t()

Run a command with the given argv, capturing output and return value.