mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-24 00:51:19 +00:00
Redistribute all tests from the monolithic cli.rs (2190 lines) and the
standalone tests from scenario.rs into their respective cmd/ files,
completing the migration to the one-file-per-subcommand structure.
- Delete cli.rs entirely; move tests to cmd/{run,config,llm,exec,doctor,serve}.rs
- Move scenario.rs standalone tests to cmd/{repo,secret,workflow,doctor}.rs
- Slim scenario.rs to only 6 parametrized E2E workflow scenarios + run lifecycle
- Create new cmd/serve.rs and cmd/workflow.rs modules
- Remove duplicate tests already covered by snapshot tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
751 B
Rust
33 lines
751 B
Rust
use fabro_test::{fabro_snapshot, test_context};
|
|
|
|
#[test]
|
|
fn version() {
|
|
let context = test_context!();
|
|
let mut cmd = context.command();
|
|
cmd.arg("--version");
|
|
fabro_snapshot!(context.filters(), cmd, @"
|
|
success: true
|
|
exit_code: 0
|
|
----- stdout -----
|
|
fabro [VERSION] ([BUILD])
|
|
----- stderr -----
|
|
");
|
|
}
|
|
|
|
#[test]
|
|
fn no_dotenv_flag() {
|
|
let context = test_context!();
|
|
let mut cmd = context.command();
|
|
cmd.args(["--no-dotenv", "doctor"]);
|
|
fabro_snapshot!(context.filters(), cmd, @"
|
|
success: false
|
|
exit_code: 2
|
|
----- stdout -----
|
|
----- stderr -----
|
|
error: unexpected argument '--no-dotenv' found
|
|
|
|
Usage: fabro [OPTIONS] <COMMAND>
|
|
|
|
For more information, try '--help'.
|
|
");
|
|
}
|