mirror of
https://github.com/Dasemu/Grove.git
synced 2026-11-27 07:46:13 +00:00
test(core): remove temp dirs after tests via shared RAII helper
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09fbf79e87
commit
00226b4178
9 files changed
+115
-48
No files matched your search
@@ -9,6 +9,7 @@ use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
struct World {
|
||||
_tmp: common::tmp::TempDir,
|
||||
base: PathBuf,
|
||||
remote: PathBuf,
|
||||
g1: Git,
|
||||
@@ -19,7 +20,8 @@ struct World {
|
||||
|
||||
/// Bare remote plus two plain clones (machines "m1" and "m2") sharing `main` with one commit.
|
||||
fn world() -> World {
|
||||
let base = tmpdir("recv");
|
||||
let tmp = tmpdir("recv");
|
||||
let base = tmp.to_path_buf();
|
||||
let remote = base.join("remote.git");
|
||||
Git::new(&base)
|
||||
.run(&[
|
||||
@@ -51,6 +53,7 @@ fn world() -> World {
|
||||
g2.run(&["config", "user.email", "t@t"]).unwrap();
|
||||
g2.run(&["config", "user.name", "t"]).unwrap();
|
||||
World {
|
||||
_tmp: tmp,
|
||||
base,
|
||||
remote,
|
||||
g1,
|
||||
|
||||
Reference in new issue
Block a user