use isoloom_spec::model::{Spec, Target};
use crate::{Environment, Lab};
pub(crate) fn lab(yaml: &str) -> Lab {
Lab::parse(yaml).unwrap_or_else(|problems| panic!("the test's spec parses: {problems:?}"))
}
pub(crate) fn valid(yaml: &str) -> Lab {
let lab = lab(yaml);
assert_eq!(lab.problems(), [], "the test's spec is valid");
lab
}
pub(crate) fn spec(yaml: &str) -> Spec {
lab(yaml).spec()
}
pub(crate) fn planned(lab: &Lab, target: Target) -> Environment {
Environment::build(&lab.for_target(target), target, None)
}
pub(crate) fn environment(yaml: &str, target: Target) -> Environment {
planned(&lab(yaml), target)
}