diff options
author | Daniel Mueller <deso@posteo.net> | 2020-07-08 09:16:56 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-07-08 09:16:56 -0700 |
commit | eb4419bfd990f0abe75e5e7c248fe1e7efa0843a (patch) | |
tree | 3d0256f65ff317e9d0f41816d2841692e8743cac /src/tests/config.rs | |
parent | 1abd0153b5fbacf5fff89406dc34924f84205c3a (diff) | |
download | nitrocli-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/config.rs')
-rw-r--r-- | src/tests/config.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tests/config.rs b/src/tests/config.rs index fa311d5..3542ecf 100644 --- a/src/tests/config.rs +++ b/src/tests/config.rs @@ -55,8 +55,10 @@ $"#, #[test_device] fn set_wrong_usage(model: nitrokey::Model) { - let res = Nitrocli::with_model(model).handle(&["config", "set", "--numlock", "2", "-N"]); - let err = res.unwrap_str_err(); + let err = Nitrocli::with_model(model) + .handle(&["config", "set", "--numlock", "2", "-N"]) + .unwrap_err() + .to_string(); assert!( err.contains("The argument '--numlock <numlock>' cannot be used with '--no-numlock'"), err, |