In which my tests will supply answers to the input stream based on the output received in the output stream. An answering machine, if you will.
Recently, form.WithOutput(out) was introduced which I'm grateful for, but I'd love to have an WithInput as well.
Describe the solution you'd like
I'd like WithInput(in io.Reader) to be added to the form objects to avoid having to use tea directly. Perhaps you could even introduce a piece of documentation on how to use it with 2 io.Pipe's to simulate user input based on questions in the output.
Is your feature request related to a problem? Please describe.
I'm a unit-test freak and I'm currently using the following construct to unit-test my
cobra
commands withhuh
:In which my tests will supply answers to the input stream based on the output received in the output stream. An answering machine, if you will.
Recently,
form.WithOutput(out)
was introduced which I'm grateful for, but I'd love to have anWithInput
as well.Describe the solution you'd like
I'd like
WithInput(in io.Reader)
to be added to the form objects to avoid having to use tea directly. Perhaps you could even introduce a piece of documentation on how to use it with 2io.Pipe
's to simulate user input based on questions in the output.Describe alternatives you've considered
I'll keep using the above mentioned workaround.
Additional context
Related: #187