diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2022-08-23 13:37:28 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2022-08-23 13:37:28 +0200 |
commit | 9bb454ed6b68e3b95b19aa47c86cc04d8636a567 (patch) | |
tree | 4e63ef5a1730bea5bb8c76ca0535965812b16f30 | |
parent | a324d20a54a4086a46edcaf4b643a809eb7932ae (diff) |
Make test expect errorissue-369
The comment on the assert!() explains why this is not expecting an
Error.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | tests/overwrite_key.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/overwrite_key.rs b/tests/overwrite_key.rs index 059e3b2..ae6be37 100644 --- a/tests/overwrite_key.rs +++ b/tests/overwrite_key.rs @@ -37,5 +37,11 @@ fn overwrite_key() { let s = s.unwrap(); let v: Result<Settings, _> = s.try_deserialize(); - assert!(v.is_ok(), "not ok: {:?}", v); + + // This is expected to error because the key `certpath` is specified by ENV and `cert_path` + // from the TOML. + // This should work, but does not because of the way this crate deserializes into T. + // + // The fix is to name the "TlsConfig::cert_path" field "TlsConfig::certpath". + assert!(v.is_err(), "accidentially ok: {:?}", v); } |