Test helpers for a CLI built with usage.
A CLI's observable surface is three things: what a command line parses to, what a user is shown when it does not, and what a shell offers while one is being typed. All three are testable from the static tables the derive already emits — no process to spawn, no terminal to fake — and none of them was pleasant to reach for. This crate is the reaching.
What it is not is a second implementation of any of them. Every page here comes from
[usage_argv::help::page], the same function parse() renders a help request with, and
every failure from [usage_argv::render_failure_plain], the same renderer it prints with —
asked for plain text, so an assertion does not turn on whether stderr was a terminal. A
harness that renders its own approximation of a help page is a harness whose passing tests
mean nothing, so the rule is that nothing in this crate formats a page.
# use Spec;
#
Enable it as a dev-dependency feature of the facade:
[]
= { = "usage-rs", = "6", = ["test"] }