self review fixes

pull/5512/head
Marcin Niemira 2019-10-01 23:49:49 +10:00
parent e3a84f5f60
commit 8d95d98348
No known key found for this signature in database
GPG Key ID: 5395D4A81A3FA475
1 changed files with 5 additions and 7 deletions

View File

@ -36,13 +36,11 @@ func (copyFailRunner) Copy(a assets.CopyableFile) error {
return fmt.Errorf("test error during copy file")
}
func newFakeCommandRunnerCopyFail() command.Runner {
return copyFailRunner{command.NewFakeCommandRunner()}
}
func TestCopyBinary(t *testing.T) {
fakeCommandRunnerCopyFail := func() command.Runner {
r := command.NewFakeCommandRunner()
return copyFailRunner{r}
}
var tc = []struct {
lastUpdateCheckFilePath string
src, dst, desc string
@ -68,7 +66,7 @@ func TestCopyBinary(t *testing.T) {
dst: "/etc/passwd",
src: "/etc/hosts",
err: true,
runner: fakeCommandRunnerCopyFail(),
runner: newFakeCommandRunnerCopyFail(),
},
}
for _, test := range tc {