fabro/lib/crates/fabro-cli/tests/it/cmd/cli_reference.rs
Bryan Helmkamp be084c1944
refactor(dev): decouple CLI reference generation
Expose the CLI reference renderer through a hidden fabro subcommand so fabro-dev can refresh docs without linking fabro-cli. Gate the fabro-dev binary behind the dev feature and update the cargo dev alias to opt into it explicitly.
2026-05-06 12:31:02 -04:00

32 lines
913 B
Rust

use fabro_test::test_context;
#[test]
fn emits_cli_reference_markdown() {
let context = test_context!();
let output = context
.command()
.arg("__cli-reference")
.assert()
.success()
.get_output()
.clone();
let stdout = String::from_utf8(output.stdout).expect("stdout should be valid UTF-8");
assert!(
stdout.contains("## `fabro`"),
"CLI reference should include the root command:\n{stdout}"
);
assert!(
stdout.contains("### `fabro run`"),
"CLI reference should include visible subcommands:\n{stdout}"
);
assert!(
!stdout.contains("__cli-reference"),
"CLI reference should not include hidden commands:\n{stdout}"
);
assert!(
output.stderr.is_empty(),
"CLI reference command should not emit stderr: {}",
String::from_utf8_lossy(&output.stderr)
);
}