aboutsummaryrefslogtreecommitdiff
path: root/src/tests/encrypted.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2020-07-08 09:16:56 -0700
committerDaniel Mueller <deso@posteo.net>2020-07-08 09:16:56 -0700
commiteb4419bfd990f0abe75e5e7c248fe1e7efa0843a (patch)
tree3d0256f65ff317e9d0f41816d2841692e8743cac /src/tests/encrypted.rs
parent1abd0153b5fbacf5fff89406dc34924f84205c3a (diff)
downloadnitrocli-eb4419bfd990f0abe75e5e7c248fe1e7efa0843a.tar.gz
nitrocli-eb4419bfd990f0abe75e5e7c248fe1e7efa0843a.tar.bz2
Remove unwrap_str_err method from UnwrapError test trait
With upcoming changes we intend to move towards a model where we do not distinguish the individual error variants the program deals with in a global enum. In preparation of such a change, this patch marks a first step in removing the UnwrapError test trait, which relies on the existence of exactly such typed errors. In particular, we remove the unwrap_str_err method from it, basically falling back to just working with strings.
Diffstat (limited to 'src/tests/encrypted.rs')
-rw-r--r--src/tests/encrypted.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tests/encrypted.rs b/src/tests/encrypted.rs
index aed2662..a47c3c9 100644
--- a/src/tests/encrypted.rs
+++ b/src/tests/encrypted.rs
@@ -1,7 +1,7 @@
// encrypted.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 *
@@ -61,9 +61,12 @@ $"#,
#[test_device(pro)]
fn encrypted_open_on_pro(model: nitrokey::Model) {
- let res = Nitrocli::with_model(model).handle(&["encrypted", "open"]);
+ let err = Nitrocli::with_model(model)
+ .handle(&["encrypted", "open"])
+ .unwrap_err()
+ .to_string();
assert_eq!(
- res.unwrap_str_err(),
+ err,
"This command is only available on the Nitrokey Storage",
);
}