Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Fix tests so they don't emit an extraneous `config.toml` in the source tree (#6853)

Eric Traut9275e933648d
diff --git a/codex-rs/tui/src/onboarding/trust_directory.rs b/codex-rs/tui/src/onboarding/trust_directory.rs
index fd24b8e888..cf5d6e9a1a 100644
--- a/codex-rs/tui/src/onboarding/trust_directory.rs
+++ b/codex-rs/tui/src/onboarding/trust_directory.rs
@@ -189,13 +189,14 @@ mod tests {
use crossterm::event::KeyModifiers;
use pretty_assertions::assert_eq;
use ratatui::Terminal;
-
use std::path::PathBuf;
+ use tempfile::TempDir;
#[test]
fn release_event_does_not_change_selection() {
+ let codex_home = TempDir::new().expect("temp home");
let mut widget = TrustDirectoryWidget {
- codex_home: PathBuf::from("."),
+ codex_home: codex_home.path().to_path_buf(),
cwd: PathBuf::from("."),
is_git_repo: false,
selection: None,
@@ -217,8 +218,9 @@ mod tests {
#[test]
fn renders_snapshot_for_git_repo() {
+ let codex_home = TempDir::new().expect("temp home");
let widget = TrustDirectoryWidget {
- codex_home: PathBuf::from("."),
+ codex_home: codex_home.path().to_path_buf(),
cwd: PathBuf::from("/workspace/project"),
is_git_repo: true,
selection: None,