testutil: remove unnecessary testutil.MockCmd.Restore()
While looking over the code I noticed that the `Restore()` helper is not needed (and arguably wrong as it does not reset PATH). We already use `t.TempDir()` and `t.Setenv()` as part of the command setup so manually cleanup is not neccessary (and is today even incomplete). So YAGNI and we can remove Restore().
This commit is contained in:
parent
9717980d3f
commit
bb45b89d84
4 changed files with 7 additions and 22 deletions
|
|
@ -41,10 +41,6 @@ func (mc *MockCmd) Path() string {
|
|||
return filepath.Join(mc.binDir, mc.name)
|
||||
}
|
||||
|
||||
func (mc *MockCmd) Restore() error {
|
||||
return os.RemoveAll(mc.binDir)
|
||||
}
|
||||
|
||||
func (mc *MockCmd) Calls() [][]string {
|
||||
b, err := os.ReadFile(mc.Path() + ".run")
|
||||
if os.IsNotExist(err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue