[−][src]Macro rubric::attach
Attaches tests to criteria in a rubric.
This will accept a rubric and one or more function names. It will
then attempt to find a criterion for each function passed in. The criteria
should have a func
field that matches the name of the function. It will panic
if it doesn't find a matching criteria.
When you create a rubric from yaml
, the criteria inside
don't have tests attached to them. You can call
Rubric.attach()
to achieve the
same thing, but this is faster and easier.
Example
// A test meant to be attached to a criteria
fn some_test(_: &TestData) -> bool {
true
}
fn main() {
let mut rubric = Rubric::from_yaml(/* some yaml data */);
// Assuming there is a criterion with:
// func: some_test
attach!(rubric, some_test);
// or be explicit
// This is the same thing
attach! {
rubric,
"non_matching_func_key" => some_test
}
}