pub struct MockSubprocessRuntime { /* private fields */ }Expand description
Mock subprocess runtime for testing.
Implementations§
Source§impl MockSubprocessRuntime
impl MockSubprocessRuntime
Sourcepub fn add_response(&self, response: MockResponse)
pub fn add_response(&self, response: MockResponse)
Add a response to be returned for the next command.
Sourcepub fn set_default_response(&mut self, response: MockResponse)
pub fn set_default_response(&mut self, response: MockResponse)
Set the default response when no queued responses remain.
Sourcepub fn invocations(&self) -> Vec<CommandInvocation>
pub fn invocations(&self) -> Vec<CommandInvocation>
Get all recorded invocations.
Sourcepub fn clear_invocations(&self)
pub fn clear_invocations(&self)
Clear recorded invocations.
Trait Implementations§
Source§impl Default for MockSubprocessRuntime
impl Default for MockSubprocessRuntime
Source§impl SubprocessRuntime for MockSubprocessRuntime
impl SubprocessRuntime for MockSubprocessRuntime
Source§fn run_command(
&self,
program: &str,
args: &[&str],
stdin: Option<&[u8]>,
) -> Result<SubprocessOutput, SubprocessError>
fn run_command( &self, program: &str, args: &[&str], stdin: Option<&[u8]>, ) -> Result<SubprocessOutput, SubprocessError>
Execute a command with the given arguments and optional stdin.
Auto Trait Implementations§
impl Freeze for MockSubprocessRuntime
impl RefUnwindSafe for MockSubprocessRuntime
impl Send for MockSubprocessRuntime
impl Sync for MockSubprocessRuntime
impl Unpin for MockSubprocessRuntime
impl UnsafeUnpin for MockSubprocessRuntime
impl UnwindSafe for MockSubprocessRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more