From e40ae3649d62a933211e81d8ac773fdd86ff1dfb Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 21 Feb 2026 20:54:29 +0900 Subject: test(cli): add end-to-end integration tests for CLI commands Add 23 integration tests using assert_cmd and predicates covering about, validate, show, licenses, install, config, init, and dump-autoload commands with shared test helpers and fixture projects. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/tests/cli_dump_autoload.rs | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 crates/mozart/tests/cli_dump_autoload.rs (limited to 'crates/mozart/tests/cli_dump_autoload.rs') diff --git a/crates/mozart/tests/cli_dump_autoload.rs b/crates/mozart/tests/cli_dump_autoload.rs new file mode 100644 index 0000000..ca592a3 --- /dev/null +++ b/crates/mozart/tests/cli_dump_autoload.rs @@ -0,0 +1,34 @@ +mod common; + +use predicates::str::contains; + +#[test] +fn test_dump_autoload_dry_run() { + let project = common::copy_fixture_to_temp("minimal"); + common::mozart_cmd() + .arg("dump-autoload") + .arg("--dry-run") + .arg("--working-dir") + .arg(project.path()) + .assert() + .success() + .stderr(contains("Dry run")); +} + +#[test] +fn test_dump_autoload_does_not_write_in_dry_run() { + let project = common::copy_fixture_to_temp("minimal"); + let vendor_dir = project.path().join("vendor"); + common::mozart_cmd() + .arg("dump-autoload") + .arg("--dry-run") + .arg("--working-dir") + .arg(project.path()) + .assert() + .success(); + // In dry-run mode, no vendor directory should have been created + assert!( + !vendor_dir.exists(), + "vendor/ should not be created in dry-run mode" + ); +} -- cgit v1.3.1