aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/tests/cli_dump_autoload.rs
blob: 8b7ccbf471e5b4b1d5d20d3b39ae8dde5d193757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
mod common;

#[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();
}

#[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"
    );
}