mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
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.
32 lines
913 B
Rust
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)
|
|
);
|
|
}
|