We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
MockSystem
1 parent 47124ed commit ca95567Copy full SHA for ca95567
src/utils/worker_mock.rs
@@ -27,7 +27,7 @@ pub mod tests {
27
fn default() -> Self {
28
Self::new(Distribution {
29
id: "Ubuntu".to_string(),
30
- release: "24.10".to_string(),
+ release: "24.04".to_string(),
31
})
32
}
33
@@ -73,8 +73,12 @@ pub mod tests {
73
impl Worker for MockSystem {
74
fn run(&self, cmd: &Command) -> Result<Output> {
75
self.commands.borrow_mut().push(cmd.command());
76
+ let mocked = self.mocked_commands.borrow();
77
+ let default_stdout = String::default();
78
+ let stdout = mocked.get(&cmd.command()).unwrap_or(&default_stdout);
79
+
80
Ok(Output {
- stdout: Vec::new(),
81
+ stdout: stdout.as_bytes().to_vec(),
82
stderr: Vec::new(),
83
status: std::process::ExitStatus::default(),
84
0 commit comments