hive-forge: inline test Args literals, drop the 4-bool helper (clippy::fn_params_excessive_bools)
This commit is contained in:
parent
f85db2b773
commit
7b4ef40688
1 changed files with 14 additions and 12 deletions
|
|
@ -128,19 +128,15 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
|
|||
mod tests {
|
||||
use super::{Args, reject_ignore};
|
||||
|
||||
fn args(watch: bool, ignore: bool, unwatch: bool, list: bool) -> Args {
|
||||
Args {
|
||||
watch,
|
||||
ignore,
|
||||
unwatch,
|
||||
list,
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ignore_is_rejected_pointing_at_unwatch() {
|
||||
let err =
|
||||
reject_ignore(&args(false, true, false, false)).expect_err("--ignore must be refused");
|
||||
let args = Args {
|
||||
watch: false,
|
||||
ignore: true,
|
||||
unwatch: false,
|
||||
list: false,
|
||||
};
|
||||
let err = reject_ignore(&args).expect_err("--ignore must be refused");
|
||||
let msg = err.to_string();
|
||||
assert!(msg.contains("--unwatch"));
|
||||
assert!(msg.contains("--watch"));
|
||||
|
|
@ -149,6 +145,12 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn watch_is_not_rejected() {
|
||||
assert!(reject_ignore(&args(true, false, false, false)).is_ok());
|
||||
let args = Args {
|
||||
watch: true,
|
||||
ignore: false,
|
||||
unwatch: false,
|
||||
list: false,
|
||||
};
|
||||
assert!(reject_ignore(&args).is_ok());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue