From b3300a708263751e781315a877beef4821f67341 Mon Sep 17 00:00:00 2001 From: veeso Date: Wed, 23 Oct 2024 23:18:15 +0200 Subject: [PATCH] fix: test --- .github/workflows/macos.yml | 2 -- remotefs-fuse/tests/fuse/mod.rs | 18 +++++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8bd400a..2f67752 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,8 +11,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install dependencies - run: brew update && brew install macfuse samba - uses: dtolnay/rust-toolchain@stable with: toolchain: stable diff --git a/remotefs-fuse/tests/fuse/mod.rs b/remotefs-fuse/tests/fuse/mod.rs index 3b2a5dd..25f583e 100644 --- a/remotefs-fuse/tests/fuse/mod.rs +++ b/remotefs-fuse/tests/fuse/mod.rs @@ -55,6 +55,16 @@ fn mount(p: &Path) -> (UmountLock, JoinHandle<()>) { (umount, join) } +fn umount(umount: UmountLock) { + umount + .lock() + .unwrap() + .as_mut() + .unwrap() + .umount() + .expect("Failed to unmount"); +} + #[test] fn test_should_mount_fs() { let mnt = TempDir::new().expect("Failed to create tempdir"); @@ -70,13 +80,7 @@ fn test_should_mount_fs() { assert!(mounted_file_path.exists()); // unmount - umounter - .lock() - .unwrap() - .as_mut() - .unwrap() - .umount() - .expect("Failed to unmount"); + umount(umounter); join.join().expect("Failed to join thread"); }