test

package
v0.0.0-...-af3aebc Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyRun

func EmptyRun(*cobra.Command, []string)

EmptyRun - utility function for null command

Types

type MockGitHubService

type MockGitHubService struct {
	mock.Mock
}

MockGitHubService - a mocked GitHubService for testing

func NewMockGitHubService

func NewMockGitHubService() *MockGitHubService

NewMockGitHubService - utility function to create a new test instance

func (*MockGitHubService) CreatePullRequest

func (service *MockGitHubService) CreatePullRequest(newPr *services.NewPullRequest, repo services.GitHubRepoID) (*github.PullRequest, error)

CreatePullRequest - stubbed method

func (*MockGitHubService) GetRepository

func (service *MockGitHubService) GetRepository(repo services.GitHubRepoID) (*github.Repository, error)

GetRepository - stubbed method

func (*MockGitHubService) ListReleases

func (service *MockGitHubService) ListReleases(repo services.GitHubRepoID) ([]*github.RepositoryRelease, error)

ListReleases - stubbed method

type Result

type Result struct {
	Err error
	Out string
}

Result - returns the resulting error and the combined stdout and stderr output of the executed command

func ExecCommand

func ExecCommand(cmd *cobra.Command) Result

ExecCommand - runs a command under test and returns execution info in the TestResult return value

Jump to

Keyboard shortcuts

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