Convert workflow list test to use fabro_snapshot

Replace predicates::str::contains assertion with a full snapshot,
making the test more precise and consistent with other cmd/ tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-30 08:59:10 -04:00
parent cb072aed75
commit b638b8d84f
No known key found for this signature in database

View file

@ -1,5 +1,4 @@
use fabro_test::test_context;
use predicates;
use fabro_test::{fabro_snapshot, test_context};
#[test]
fn list() {
@ -12,12 +11,22 @@ fn list() {
"version = 1\ngoal = \"A test workflow\"\n",
);
context
.command()
.args(["workflow", "list"])
.current_dir(&context.temp_dir)
.assert()
.success()
// workflow list prints to stderr
.stderr(predicates::str::contains("my_test_wf"));
let mut cmd = context.command();
cmd.args(["workflow", "list"]);
cmd.current_dir(&context.temp_dir);
fabro_snapshot!(context.filters(), cmd, @"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
1 workflow(s) found
User Workflows (~/.fabro/workflows)
(none)
Project Workflows (workflows)
NAME DESCRIPTION
my_test_wf A test workflow
");
}