Add test: imag-ids reports id after it was created

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-10-13 10:11:59 +02:00
parent ceabde799b
commit 61a1a241c8

View file

@ -57,3 +57,14 @@ fn test_no_ids_after_init() {
.stdout(predicate::eq(b"" as &[u8])); .stdout(predicate::eq(b"" as &[u8]));
} }
#[test]
fn test_one_id_after_creating_one_entry() {
crate::setup_logging();
let imag_home = crate::imag::make_temphome();
crate::imag_init::call(&imag_home);
crate::imag_create::call(&imag_home, &["test"]);
let ids = call(&imag_home);
assert_eq!(ids.len(), 1);
assert_eq!(ids[0], "test");
}