Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureOutStreams ¶ added in v1.40.0
CaptureOutStreams redirects stdout & stderr while running fn and returns the outputs as a string. If there's an error during capture, it returns the error, otherwise it returns the error returned by fn.
func TestCommand ¶ added in v1.42.0
func TestCommand(t *testing.T, cmd TestableCommand, cases map[string]TestCase)
Types ¶
type Fixture ¶
type Fixture struct { MockController *gomock.Controller Client *hcapi2_mock.MockClient ActionWaiter *state.MockActionWaiter TokenEnsurer *state.MockTokenEnsurer Config *config.MockConfig }
Fixture provides affordances for testing CLI commands.
func (*Fixture) ExpectEnsureToken ¶
func (f *Fixture) ExpectEnsureToken()
ExpectEnsureToken makes the mock TokenEnsurer expect a EnsureToken call.
func (*Fixture) Finish ¶
func (f *Fixture) Finish()
Finish must be called after the test is finished, preferably via `defer` directly after creating the Fixture.
Click to show internal directories.
Click to hide internal directories.