diff --git a/tests/test.rs b/tests/test.rs index f1b73bf161..4428109349 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,4 +1,4 @@ -use {super::*, pretty_assertions::assert_eq}; +use {super::*, fs::Permissions, pretty_assertions::assert_eq}; macro_rules! test { { @@ -99,6 +99,11 @@ impl Test { self } + pub(crate) fn chmod(self, path: impl AsRef, perm: Permissions) -> Self { + fs::set_permissions(self.tempdir.path().join(path.as_ref()), perm).unwrap(); + self + } + pub(crate) fn current_dir(mut self, path: impl AsRef) -> Self { path.as_ref().clone_into(&mut self.current_dir); self