use spurs::{cmd, SshCommand};
pub fn rpm_install(pkg: &str) -> SshCommand {
cmd!("sudo rpm -ivh {}", pkg)
}
pub fn yum_install(pkgs: &[&str]) -> SshCommand {
cmd!("sudo yum install -y {}", pkgs.join(" "))
}
#[cfg(test)]
mod test {
use spurs::SshCommand;
#[test]
fn test_rpm_install() {
assert_eq!(
super::rpm_install("foobar"),
SshCommand::make_cmd(
"sudo rpm -ivh foobar".into(),
None,
false,
false,
false,
false,
),
);
}
#[test]
fn test_yum_install() {
assert_eq!(
super::yum_install(&["foobar"]),
SshCommand::make_cmd(
"sudo yum install -y foobar".into(),
None,
false,
false,
false,
false,
),
);
}
}