From eb4419bfd990f0abe75e5e7c248fe1e7efa0843a Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Wed, 8 Jul 2020 09:16:56 -0700 Subject: 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. --- src/tests/encrypted.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/tests/encrypted.rs') 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", ); } -- cgit v1.2.1