mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-03 02:24:33 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
d986fc9751
commit
d9929a24d7
1 changed files with 3 additions and 0 deletions
|
|
@ -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<HashMap<String, String>> {
|
||||
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()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue