From d9929a24d7be320747f9e226912341029275fb26 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Fri, 11 Sep 2026 13:36:57 -0600 Subject: [PATCH] Keep the driver's own BASH_ENV blank out of a recorded command's env The test double's captured environment stopped filtering the BASH_ENV blank when fabro's exec policy stopped inserting one, but the driver's Bash helper still records its own blank on the spec, so a test comparing the caller's variables saw an extra entry. Co-Authored-By: Claude Fable 5.1 --- lib/components/fabro-sandbox/src/test_support.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/components/fabro-sandbox/src/test_support.rs b/lib/components/fabro-sandbox/src/test_support.rs index 67f2d9d09..7b9b8ad96 100644 --- a/lib/components/fabro-sandbox/src/test_support.rs +++ b/lib/components/fabro-sandbox/src/test_support.rs @@ -280,10 +280,13 @@ impl MockSandbox { } /// The explicit variables of the last command as the caller passed them. + /// The driver's Bash helper records its own `BASH_ENV` blank on the + /// spec; that is not the caller's. pub fn captured_env_vars(&self) -> Option> { self.recorded().last().map(|spec| { spec.env .iter() + .filter(|(key, _)| key.as_str() != sandbox_driver::BASH_ENV_VAR) .map(|(k, v)| (k.clone(), v.clone())) .collect() })