mirror of
https://github.com/qwjyh/xdbm
synced 2024-12-05 04:51:04 +09:00
add(test): command status test
This commit is contained in:
parent
315a75424a
commit
bce9f3710c
1 changed files with 43 additions and 0 deletions
43
tests/cli.rs
43
tests/cli.rs
|
@ -463,6 +463,49 @@ mod integrated_test {
|
|||
.and(predicate::str::contains("---").not()),
|
||||
);
|
||||
|
||||
// status
|
||||
Command::cargo_bin("xdbm")?
|
||||
.arg("-c")
|
||||
.arg(config_dir_2.path())
|
||||
.arg("status")
|
||||
.assert()
|
||||
.success();
|
||||
Command::cargo_bin("xdbm")?
|
||||
.arg("-c")
|
||||
.arg(config_dir_2.path())
|
||||
.arg("status")
|
||||
.arg("-s")
|
||||
.arg(backup_src.clone().join("foo"))
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("nas").and(predicate::str::contains("foodoc").not()));
|
||||
Command::cargo_bin("xdbm")?
|
||||
.arg("-c")
|
||||
.arg(config_dir_2.path())
|
||||
.arg("status")
|
||||
.arg("-sb")
|
||||
.arg(backup_src.clone().join("foo"))
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(
|
||||
predicate::str::contains("nas")
|
||||
.and(predicate::str::contains("second"))
|
||||
.and(predicate::str::contains("foodoc")),
|
||||
);
|
||||
Command::cargo_bin("xdbm")?
|
||||
.arg("-c")
|
||||
.arg(config_dir_2.path())
|
||||
.arg("status")
|
||||
.arg("-sb")
|
||||
.arg(backup_src.clone().parent().unwrap())
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(
|
||||
predicate::str::contains("nas")
|
||||
.and(predicate::str::contains("second"))
|
||||
.and(predicate::str::contains("foodoc").not()),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue