Every test starts with very similar code that looks something like this:
let mut path = tests::resources();
path.push("some_test_directory");
let out = TempDir::new("some_test_directory").expect("Could not create tempdir for test");
tests::run_with_args(
"cargo",
&[
"run",
"--",
path.to_str().unwrap(),
"--ignore-config",
"--out",
out.path().to_str().unwrap(),
],
None,
);
Since this code is used in basically every test, it would be a good idea to move the code to a function that returns out and, if it's used (I can't remember if any tests use it or not), path.
Every test starts with very similar code that looks something like this:
Since this code is used in basically every test, it would be a good idea to move the code to a function that returns
out
and, if it's used (I can't remember if any tests use it or not),path
.