Documentation
¶
Overview ¶
Package mock provides a testify-based implementation of invoke.Environment. It is intended for tests and test-support packages, not production runtime use.
Usage:
m := mock.New()
m.On("Run", ctx, mock.AnythingOfType("*invoke.Command")).
Return(&invoke.Result{ExitCode: 0}, nil)
Index ¶
- func WriteOutput(w io.Writer, content string) func(mock.Arguments)
- type Environment
- func (m *Environment) Close() error
- func (m *Environment) Download(ctx context.Context, remotePath, localPath string, opts ...invoke.FileOption) error
- func (m *Environment) LookPath(_ context.Context, file string) (string, error)
- func (m *Environment) Run(ctx context.Context, cmd *invoke.Command) (*invoke.Result, error)
- func (m *Environment) Start(ctx context.Context, cmd *invoke.Command) (invoke.Process, error)
- func (m *Environment) TargetOS() invoke.TargetOS
- func (m *Environment) Upload(ctx context.Context, localPath, remotePath string, opts ...invoke.FileOption) error
- type Process
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Environment ¶
Environment implements a mock invoke.Environment using testify/mock.
func (*Environment) Close ¶
func (m *Environment) Close() error
Close mocks closing the environment.
func (*Environment) Download ¶
func (m *Environment) Download(ctx context.Context, remotePath, localPath string, opts ...invoke.FileOption) error
Download mocks downloading a file from the remote environment.
func (*Environment) TargetOS ¶
func (m *Environment) TargetOS() invoke.TargetOS
TargetOS mocks returning the target operating system.
func (*Environment) Upload ¶
func (m *Environment) Upload(ctx context.Context, localPath, remotePath string, opts ...invoke.FileOption) error
Upload mocks uploading a file to the remote environment.
Click to show internal directories.
Click to hide internal directories.