Skip to content

Commit

Permalink
Allow calling chmod in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
artm committed Aug 24, 2024
1 parent f25e2d7 commit 91913c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use {super::*, pretty_assertions::assert_eq};
use {super::*, fs::Permissions, pretty_assertions::assert_eq};

macro_rules! test {
{
Expand Down Expand Up @@ -99,6 +99,11 @@ impl Test {
self
}

pub(crate) fn chmod(self, path: impl AsRef<Path>, 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<Path>) -> Self {
path.as_ref().clone_into(&mut self.current_dir);
self
Expand Down

0 comments on commit 91913c8

Please sign in to comment.