diff --git a/src/monorepo/workspace_test.rs b/src/monorepo/workspace_test.rs index 1be75f0..6201822 100644 --- a/src/monorepo/workspace_test.rs +++ b/src/monorepo/workspace_test.rs @@ -1,33 +1,9 @@ -use std::ffi::OsString; use std::path::PathBuf; use monorepo::workspace::resolve_workspace_path; const BUILD_WORKSPACE_DIRECTORY: &str = "BUILD_WORKSPACE_DIRECTORY"; -struct EnvRestore { - value: Option, -} - -impl EnvRestore { - fn capture() -> Self { - Self { - value: std::env::var_os(BUILD_WORKSPACE_DIRECTORY), - } - } -} - -impl Drop for EnvRestore { - fn drop(&mut self) { - unsafe { - if let Some(value) = &self.value { - std::env::set_var(BUILD_WORKSPACE_DIRECTORY, value); - } else { - std::env::remove_var(BUILD_WORKSPACE_DIRECTORY); - } - } - } -} #[derive(Debug)] struct Case { @@ -39,8 +15,6 @@ struct Case { #[test] fn resolve_workspace_path_cases() { - let _restore = EnvRestore::capture(); - let cases = [ Case { name: "absolute path returns unchanged path",