Documentation
¶
Index ¶
- Variables
- func CopyTestRepo(log fatalLogger, name string) string
- func Eq(t *testing.T, got any, expected any)
- func ExecuteCommand(cmd *cobra.Command, cli string, stdout *bytes.Buffer, stderr *bytes.Buffer) (*test.CmdOut, error)
- func FirstLine(output []byte) string
- func InitFactory(ios *iostreams.IOStreams, rt http.RoundTripper) *cmdutils.Factory
- func InitIOStreams(isTTY bool, doHyperlinks string) (*iostreams.IOStreams, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer)
- func InitTest(m *testing.M, suffix string)
- func NewTestFactory(t *testing.T, ios *iostreams.IOStreams, opts ...FactoryOption) *cmdutils.Factory
- func RunCommand(cmd *cobra.Command, cli string, stds ...*bytes.Buffer) (*test.CmdOut, error)
- func StubFactory(repo string) *cmdutils.Factory
- func StubFactoryWithConfig(repo string) (*cmdutils.Factory, error)
- type CmdExecFunc
- type CmdFunc
- type FactoryOption
- func WithBaseRepo(owner, repo string) FactoryOption
- func WithBaseRepoError(err error) FactoryOption
- func WithBranch(branch string) FactoryOption
- func WithBranchError(err error) FactoryOption
- func WithConfig(cfg config.Config) FactoryOption
- func WithConfigError(err error) FactoryOption
- func WithGitLabClient(client *gitlab.Client) FactoryOption
- func WithHttpClientError(err error) FactoryOption
Constants ¶
This section is empty.
Variables ¶
var ( ProjectPath string GlabBinaryPath string )
Functions ¶
func CopyTestRepo ¶
func ExecuteCommand ¶ added in v1.25.0
func InitFactory ¶ added in v1.25.0
func InitIOStreams ¶ added in v1.25.0
func NewTestFactory ¶ added in v1.60.0
func NewTestFactory(t *testing.T, ios *iostreams.IOStreams, opts ...FactoryOption) *cmdutils.Factory
NewTestFactory creates a Factory configured for testing with the given options
func RunCommand ¶
func StubFactory ¶
Types ¶
type CmdExecFunc ¶ added in v1.55.0
func SetupCmdForTest ¶ added in v1.55.0
func SetupCmdForTest(t *testing.T, cmdFunc CmdFunc, opts ...FactoryOption) CmdExecFunc
SetupCmdForTest creates a test environment with a configured Factory
type FactoryOption ¶ added in v1.55.0
FactoryOption is a function that configures a Factory
func WithBaseRepo ¶ added in v1.55.0
func WithBaseRepo(owner, repo string) FactoryOption
WithBaseRepo configures the Factory with a specific base repository
func WithBaseRepoError ¶ added in v1.60.0
func WithBaseRepoError(err error) FactoryOption
WithBaseRepoError configures the Factory to return an error when getting base repo
func WithBranch ¶ added in v1.55.0
func WithBranch(branch string) FactoryOption
WithBranch configures the Factory with a specific branch
func WithBranchError ¶ added in v1.60.0
func WithBranchError(err error) FactoryOption
WithBranchError configures the Factory to return an error when getting branch
func WithConfig ¶ added in v1.55.0
func WithConfig(cfg config.Config) FactoryOption
WithConfig configures the Factory with a specific config
func WithConfigError ¶ added in v1.55.0
func WithConfigError(err error) FactoryOption
func WithGitLabClient ¶ added in v1.55.0
func WithGitLabClient(client *gitlab.Client) FactoryOption
WithGitLabClient configures the Factory with a specific GitLab client
func WithHttpClientError ¶ added in v1.60.0
func WithHttpClientError(err error) FactoryOption
WithHttpClientError configures the Factory to return an error when creating HTTP client