Refactor factory.Executable() to be a method rather than a func

This way, factory can satisfy an interface that requires `Executable()`.
This commit is contained in:
Mislav Marohnić 2021-12-21 13:50:55 +01:00
parent 38eb894d73
commit 3cce16e72d
4 changed files with 63 additions and 64 deletions

View file

@ -147,8 +147,7 @@ func Test_NewCmdLogin(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
io, stdin, _, _ := iostreams.Test()
f := &cmdutil.Factory{
IOStreams: io,
Executable: func() string { return "/path/to/gh" },
IOStreams: io,
}
io.SetStdoutTTY(true)