Remove client/input.{Buffer,Override}Stdin() functions (#4602)

Cobra's new release made them redundant.

Thanks: Juan Leni <juan.leni@zondax.ch> for the original patch.
This commit is contained in:
Alessio Treglia
2019-06-22 11:24:59 +02:00
committed by GitHub
parent 4ffabb65a5
commit 7b5e6cee07
21 changed files with 118 additions and 148 deletions
+21
View File
@@ -0,0 +1,21 @@
package tests
import (
"bytes"
"strings"
"github.com/spf13/cobra"
)
// ApplyMockIO replaces stdin/out/err with buffers that can be used during testing.
func ApplyMockIO(c *cobra.Command) (*strings.Reader, *bytes.Buffer, *bytes.Buffer) {
mockIn := strings.NewReader("")
mockOut := bytes.NewBufferString("")
mockErr := bytes.NewBufferString("")
c.SetIn(mockIn)
c.SetOut(mockOut)
c.SetErr(mockErr)
return mockIn, mockOut, mockErr
}
// DONTCOVER