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:
+21
@@ -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
|
||||
Reference in New Issue
Block a user