From 82867f3ff6b95d0372e586cc5b36861f7679c54c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Apr 2018 14:19:08 +0200 Subject: [PATCH] Fix tests for new interface --- lib/entry/libimagentrycategory/src/store.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/entry/libimagentrycategory/src/store.rs b/lib/entry/libimagentrycategory/src/store.rs index 5fc87347..e1fb929a 100644 --- a/lib/entry/libimagentrycategory/src/store.rs +++ b/lib/entry/libimagentrycategory/src/store.rs @@ -139,8 +139,6 @@ mod tests { let res = store.create_category(category_name); assert!(res.is_ok(), format!("Expected Ok(_), got: {:?}", res)); - let res = res.unwrap(); - assert!(res); } #[test] @@ -148,11 +146,10 @@ mod tests { let category_name = "examplecategory"; let store = get_store(); - let res = store.create_category(category_name); - - assert!(res.is_ok(), format!("Expected Ok(_), got: {:?}", res)); - let res = res.unwrap(); - assert!(res); + { + let res = store.create_category(category_name); + assert!(res.is_ok(), format!("Expected Ok(_), got: {:?}", res)); + } let category = store.get(PathBuf::from(format!("category/{}", category_name))); @@ -167,11 +164,11 @@ mod tests { let _ = env_logger::try_init(); let category_name = "examplecategory"; let store = get_store(); - let res = store.create_category(category_name); - assert!(res.is_ok(), format!("Expected Ok(_), got: {:?}", res)); - let res = res.unwrap(); - assert!(res); + { + let res = store.create_category(category_name); + assert!(res.is_ok(), format!("Expected Ok(_), got: {:?}", res)); + } let id = PathBuf::from(format!("category/{}", category_name)); println!("Trying: {:?}", id);