clitest

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockCommand

func MockCommand(t *testing.T, flags []cli.Flag, args ...string) *cli.Command

MockCommand creates a mock command with the given flags and parses the supplied arguments.

func NewSessionContext

func NewSessionContext(t *testing.T, srv *httptest.Server) context.Context

NewSessionContext creates a new context with a cli.Session attached to it. The session is connected to the given server.

Types

type CommandRecorder

type CommandRecorder struct {
	*bytes.Buffer
}

func NewCommandRecorder

func NewCommandRecorder() *CommandRecorder

NewCommandRecorder creates a new command recorder.

func Record

func Record(cli *cli.Command) *CommandRecorder

Record creates a new command recorder and sets it as the writer for the given command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL