Struct trycmd::TestCases [−][src]
pub struct TestCases { /* fields omitted */ }
Expand description
Entry point for running tests
Implementations
Overwrite expected status for a test
Set default bin, by path, for commands
Set default bin, by name, for commands
Set default environment variable
Add a bin to the “PATH” for cases to use
pub fn register_bins<N: Into<String>, B: Into<Bin>>(
&self,
bins: impl IntoIterator<Item = (N, B)>
) -> &Self
pub fn register_bins<N: Into<String>, B: Into<Bin>>(
&self,
bins: impl IntoIterator<Item = (N, B)>
) -> &Self
Add a series of bins to the “PATH” for cases to use
Add a variable for normalizing output
Variable names must be
- Surrounded by
[]
- Consist of uppercase letters
Variables will be preserved through TRYCMD=overwrite
/ TRYCMD=dump
.
NOTE: We do basic search/replaces so new any new output will blindly be replaced.
Reserved names:
[..]
[EXE]
[CWD]
[ROOT]
Example
#[test]
fn cli_tests() {
trycmd::TestCases::new()
.case("tests/cmd/*.trycmd")
.insert_var("[VAR]", "value");
}
Batch add variables for normalizing output
See insert_var
.