Open janstarke opened 3 years ago
The cause is that samples_dir() assumes that the project dir is the current working dir, which is not the case when a workspace is being used.
samples_dir()
Solution:
diff --git a/tests/fixtures.rs b/tests/fixtures.rs index 5ff166e..4d760ce 100644 --- a/tests/fixtures.rs +++ b/tests/fixtures.rs @@ -20,11 +20,7 @@ pub fn ensure_env_logger_initialized() { } pub fn samples_dir() -> PathBuf { - PathBuf::from(file!()) - .parent() - .unwrap() - .parent() - .unwrap() + PathBuf::from(env!("CARGO_MANIFEST_DIR")) .join("samples") .canonicalize() .unwrap()
The cause is that
samples_dir()
assumes that the project dir is the current working dir, which is not the case when a workspace is being used.Solution: