Skip to content

Commit c486618

Browse files
committed
Fix windows test
1 parent 7131b9c commit c486618

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/tmc-langs/src/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,15 @@ mod test {
203203
fn moves_projects_dir() {
204204
init();
205205

206-
let config_location = tempfile::NamedTempFile::new().unwrap();
206+
// can't use a tempfile for the config location directly
207+
// because windows won't let us replace a tempfile while it's "open"
208+
let config_dir = tempfile::tempdir().unwrap();
209+
let config_location = config_dir.path().join("tmc_config.temp");
207210
let projects_dir = tempfile::tempdir().unwrap();
208211
let target_dir = tempfile::tempdir().unwrap();
209212

210213
let tmc_config = TmcConfig {
211-
location: config_location.path().to_path_buf(),
214+
location: config_location,
212215
projects_dir: projects_dir.path().to_path_buf(),
213216
table: Table::new(),
214217
};

0 commit comments

Comments
 (0)