test: refactor ruby and php modules to use mocked commands (#936)

This commit is contained in:
Thomas O'Donnell
2020-02-21 16:52:39 +00:00
committed by GitHub
parent c6d8031f36
commit d44c037ba5
7 changed files with 117 additions and 122 deletions
+10
View File
@@ -59,6 +59,16 @@ pub fn exec_cmd(cmd: &str, args: &[&str]) -> Option<CommandOutput> {
stdout: String::from("v12.0.0"),
stderr: String::default(),
}),
"php -r echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;" => {
Some(CommandOutput {
stdout: String::from("7.3.8"),
stderr: String::default(),
})
}
"ruby -v" => Some(CommandOutput {
stdout: String::from("ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]"),
stderr: String::default(),
}),
"stack ghc -- --numeric-version --no-install-ghc" => Some(CommandOutput {
stdout: String::from("8.6.5"),
stderr: String::default(),