aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/tests/cli_config.rs
blob: e433653d2baa1c3b37e453cad4250b7c7662675a (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
32
33
34
35
36
37
38
39
40
mod common;

use predicates::str::contains;

#[test]
fn test_config_list() {
    let project = common::copy_fixture_to_temp("minimal");
    common::mozart_cmd()
        .arg("config")
        .arg("--list")
        .arg("--working-dir")
        .arg(project.path())
        .assert()
        .success()
        .stdout(contains("vendor-dir"));
}

#[test]
fn test_config_single_key() {
    let project = common::copy_fixture_to_temp("minimal");
    common::mozart_cmd()
        .arg("config")
        .arg("vendor-dir")
        .arg("--working-dir")
        .arg(project.path())
        .assert()
        .success()
        .stdout(contains("vendor"));
}

#[test]
fn test_config_no_key_fails() {
    let project = common::copy_fixture_to_temp("minimal");
    common::mozart_cmd()
        .arg("config")
        .arg("--working-dir")
        .arg(project.path())
        .assert()
        .failure();
}