diff options
author | Daniel Mueller <deso@posteo.net> | 2020-07-09 18:57:18 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-07-09 18:57:18 -0700 |
commit | c461a506f6bf3bf73374df289298879ba9d2d125 (patch) | |
tree | 93e2f31400a71b73057b93ecb62279a47d7c80d0 /src/tests/pws.rs | |
parent | efb6fbffdb96c6acd197b8a7c4fe0ed9855a151e (diff) | |
download | nitrocli-c461a506f6bf3bf73374df289298879ba9d2d125.tar.gz nitrocli-c461a506f6bf3bf73374df289298879ba9d2d125.tar.bz2 |
Remove unwrap_lib_err method from UnwrapError test trait
This change marks the next step in getting rid of the UnwrapError test
trait. Specifically, it removes its unwrap_lib_err method.
Diffstat (limited to 'src/tests/pws.rs')
-rw-r--r-- | src/tests/pws.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/tests/pws.rs b/src/tests/pws.rs index 651b2d5..42cb847 100644 --- a/src/tests/pws.rs +++ b/src/tests/pws.rs @@ -1,7 +1,7 @@ // pws.rs // ************************************************************************* -// * Copyright (C) 2019 Daniel Mueller (deso@posteo.net) * +// * Copyright (C) 2019-2020 Daniel Mueller (deso@posteo.net) * // * * // * This program is free software: you can redistribute it and/or modify * // * it under the terms of the GNU General Public License as published by * @@ -21,15 +21,16 @@ use super::*; #[test_device] fn set_invalid_slot(model: nitrokey::Model) { - let res = Nitrocli::with_model(model).handle(&["pws", "set", "100", "name", "login", "1234"]); - - assert_eq!( - res.unwrap_lib_err(), - ( - Some("Could not write PWS slot"), - nitrokey::LibraryError::InvalidSlot - ) + let err = Nitrocli::with_model(model) + .handle(&["pws", "set", "100", "name", "login", "1234"]) + .unwrap_err() + .to_string(); + let expected = format!( + "Could not write PWS slot: {}", + nitrokey::Error::LibraryError(nitrokey::LibraryError::InvalidSlot) ); + + assert_eq!(err, expected); } #[test_device] |