Struct second_law::CmdResult
[−]
[src]
pub struct CmdResult { pub settings: Arc<SceneSettings>, pub success: bool, pub stdout: String, pub stderr: String, }
A command result is the outputs of a command (streams and status code) within a struct which has convenience assertion functions about those outputs
Fields
settings: Arc<SceneSettings>
success: bool
stdout: String
stderr: String
Methods
impl CmdResult
[src]
fn success(&self) -> Box<&CmdResult>
[src]
asserts that the command resulted in a success (zero) status code
fn failure(&self) -> Box<&CmdResult>
[src]
asserts that the command resulted in a failure (non-zero) status code
fn no_stderr(&self) -> Box<&CmdResult>
[src]
asserts that the command resulted in empty (zero-length) stderr stream output generally, it's better to use stdout_only() instead, but you might find yourself using this function if 1. you can not know exactly what stdout will be or 2. you know that stdout will also be empty
fn no_stdout(&self) -> Box<&CmdResult>
[src]
asserts that the command resulted in empty (zero-length) stderr stream output unless asserting there was neither stdout or stderr, stderr_only is usually a better choice generally, it's better to use stderr_only() instead, but you might find yourself using this function if 1. you can not know exactly what stderr will be or 2. you know that stderr will also be empty
fn stdout_is<T: AsRef<str>>(&self, msg: T) -> Box<&CmdResult>
[src]
asserts that the command resulted in stdout stream output that equals the passed in value, when both are trimmed of trailing whitespace stdout_only is a better choice unless stderr may or will be non-empty
fn stdout_is_fixture<T: AsRef<OsStr>>(
&self,
file_rel_path: T
) -> Box<&CmdResult>
[src]
&self,
file_rel_path: T
) -> Box<&CmdResult>
like stdout_is(...), but expects the contents of the file at the provided relative path
fn stderr_is<T: AsRef<str>>(&self, msg: T) -> Box<&CmdResult>
[src]
asserts that the command resulted in stderr stream output that equals the passed in value, when both are trimmed of trailing whitespace stderr_only is a better choice unless stdout may or will be non-empty
fn stderr_is_fixture<T: AsRef<OsStr>>(
&self,
file_rel_path: T
) -> Box<&CmdResult>
[src]
&self,
file_rel_path: T
) -> Box<&CmdResult>
like stderr_is(...), but expects the contents of the file at the provided relative path
fn stdout_only<T: AsRef<str>>(&self, msg: T) -> Box<&CmdResult>
[src]
asserts that 1. the command resulted in stdout stream output that equals the passed in value, when both are trimmed of trailing whitespace and 2. the command resulted in empty (zero-length) stderr stream output
fn stdout_only_fixture<T: AsRef<OsStr>>(
&self,
file_rel_path: T
) -> Box<&CmdResult>
[src]
&self,
file_rel_path: T
) -> Box<&CmdResult>
like stdout_only(...), but expects the contents of the file at the provided relative path
fn stderr_only<T: AsRef<str>>(&self, msg: T) -> Box<&CmdResult>
[src]
asserts that 1. the command resulted in stderr stream output that equals the passed in value, when both are trimmed of trailing whitespace and 2. the command resulted in empty (zero-length) stdout stream output
fn stderr_only_fixture<T: AsRef<OsStr>>(
&self,
file_rel_path: T
) -> Box<&CmdResult>
[src]
&self,
file_rel_path: T
) -> Box<&CmdResult>
like stderr_only(...), but expects the contents of the file at the provided relative path