diff options
Diffstat (limited to 'src/tests/config.rs')
-rw-r--r-- | src/tests/config.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tests/config.rs b/src/tests/config.rs index 75ec983..babd32c 100644 --- a/src/tests/config.rs +++ b/src/tests/config.rs @@ -34,17 +34,20 @@ $"#, ) .unwrap(); - let out = Nitrocli::with_model(model).handle(&["config", "get"])?; + let out = Nitrocli::new().model(model).handle(&["config", "get"])?; + assert!(re.is_match(&out), out); Ok(()) } #[test_device] fn set_wrong_usage(model: nitrokey::Model) { - let err = Nitrocli::with_model(model) + let err = Nitrocli::new() + .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, @@ -53,7 +56,7 @@ fn set_wrong_usage(model: nitrokey::Model) { #[test_device] fn set_get(model: nitrokey::Model) -> anyhow::Result<()> { - let mut ncli = Nitrocli::with_model(model); + let mut ncli = Nitrocli::new().model(model); let _ = ncli.handle(&["config", "set", "-s", "1", "-c", "0", "-N"])?; let re = regex::Regex::new( |