Skip to content

Commit 4a4f0dc

Browse files
authored
chore: added mock methods for both SetErrWriter and SetWriter (#451)
* chore: added missing SetErrWriter mock method * chore: added comments to not use SetErrWriter and SetWriter in test
1 parent 4863a83 commit 4a4f0dc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

testhelpers/terminal/test_ui.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ type FakeUI struct {
2727
PasswordPrompts []string
2828
ChoicesPrompts []choicesPrompt
2929
WarnOutputs []string
30+
stdoutWriter io.Writer
31+
stdErrWriter io.Writer
32+
stdInWriter io.Reader
3033

3134
inputs bytes.Buffer
3235
stdOut bytes.Buffer
@@ -225,6 +228,18 @@ func (ui *FakeUI) ErrWriter() io.Writer {
225228
return &ui.stdErr
226229
}
227230

231+
// NOTE: SetErrWriter is added here since the method is part of the UI type Interface interface
232+
// the method is not needed for testing
233+
func (ui *FakeUI) SetErrWriter(buf io.Writer) {
234+
panic("unimplemented")
235+
}
236+
237+
// NOTE: SetErrWriter is added here since the method is part of the UI type Interface interface
238+
// the method is not needed for testing
239+
func (ui *FakeUI) SetWriter(buf io.Writer) {
240+
panic("unimplemented")
241+
}
242+
228243
func (ui *FakeUI) SetQuiet(quiet bool) {
229244
ui.quiet = quiet
230245
}

0 commit comments

Comments
 (0)