Documentation
¶
Index ¶
- type FakedIO
- func (fake *FakedIO) Bytes() ([]byte, error)
- func (fake *FakedIO) CloseStdin() *FakedIO
- func (fake *FakedIO) Do(f func()) (string, error)
- func (fake *FakedIO) Err() error
- func (fake *FakedIO) Read(p []byte) (int, error)
- func (fake *FakedIO) Restore()
- func (fake *FakedIO) Stderr() *FakedIO
- func (fake *FakedIO) Stdin(in string) *FakedIO
- func (fake *FakedIO) StdinBytes(in []byte) *FakedIO
- func (fake *FakedIO) Stdout() *FakedIO
- func (fake *FakedIO) String() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakedIO ¶
type FakedIO struct {
// contains filtered or unexported fields
}
FakedIO represents state of faking stdout/stderr/stdin. Restore() must be called finally to restore the state.
func Stderr ¶
func Stderr() *FakedIO
Stderr starts to fake stderr and returns fakedIO object to restore input/output finally
func Stdin ¶
Stdin sets given string as faked stdin input and returns fakedIO object to restore input/output finally
func StdinBytes ¶
StdinBytes sets given bytes as faked stdin input and returns fakedIO object to restore input/output finally
func Stdout ¶
func Stdout() *FakedIO
Stdout starts to fake stdout and returns fakedIO object to restore input/output finally
func (*FakedIO) CloseStdin ¶
CloseStdin closes faked stdin
func (*FakedIO) Restore ¶
func (fake *FakedIO) Restore()
Restore restores faked stdin/stdout/stderr. This must be called finally.
func (*FakedIO) StdinBytes ¶
StdinBytes sets input buffer for stdin with bytes