test: fix Command::current_dir API

Every single call site wants to pass a path relative to the directory
the command was created for. So just make it do that automatically,
similar to `Dir::create` and friends.
This commit is contained in:
Andrew Gallant
2025-10-10 21:10:49 -04:00
parent 293ef80eaf
commit 924ba101ee
4 changed files with 24 additions and 25 deletions

View File

@@ -154,7 +154,7 @@ test
// parent ignore files and manually specified ignore files.
let mut cmd = dir.command();
cmd.args(&["--ignore-file", "../.not-an-ignore", "-l", "test"]);
cmd.current_dir(dir.path().join("baz"));
cmd.current_dir("baz");
let expected = "
baz/bar/test
test