The title says it all. I've been adding integration tests to my CLI project and most of the tests work. However some tests fail because some commands in my project prompt users with selection menus. So is there any way for me to allow user interaction in integration tests?
Here is an excerpt of the test that is failing:
pub fn run_command_visible(args: Vec<&str>) -> std::io::Result<()> {
match Command::new("ferium").args(args).status() {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
#[test]
fn remove() -> std::io::Result<()> {
println!("Remove both mods:");
run_command_visible(vec!["remove"])?;
assert!(run_command(vec!["list"]).is_err());
Ok(())
}