Documentation ¶
Index ¶
- Constants
- Variables
- func AssertExpectations(clt *Client, t *testing.T)
- func MakeLabel(name string) github.Label
- func MakeStatus(context, status string, createdAt time.Time) *github.RepoStatus
- type Client
- type IssueBuilder
- func (p *IssueBuilder) Body(body string) *IssueBuilder
- func (p *IssueBuilder) Item() gh.Item
- func (p *IssueBuilder) Labels(names []string) *IssueBuilder
- func (p *IssueBuilder) Number(number int) *IssueBuilder
- func (p *IssueBuilder) Title(title string) *IssueBuilder
- func (p *IssueBuilder) UserLogin(title string) *IssueBuilder
- type PullRequestBuilder
- func (p *PullRequestBuilder) BaseBranch(username, repository, ref string, SHA string) *PullRequestBuilder
- func (p *PullRequestBuilder) Body(body string) *PullRequestBuilder
- func (p *PullRequestBuilder) Commits(commits int) *PullRequestBuilder
- func (p *PullRequestBuilder) HeadBranch(username, repository, ref string, SHA string) *PullRequestBuilder
- func (p *PullRequestBuilder) Item() gh.Item
- func (p *PullRequestBuilder) Merged(merged bool) *PullRequestBuilder
- func (p *PullRequestBuilder) Number(number int) *PullRequestBuilder
- func (p *PullRequestBuilder) State(state string) *PullRequestBuilder
- func (p *PullRequestBuilder) Title(title string) *PullRequestBuilder
- func (p *PullRequestBuilder) UserLogin(title string) *PullRequestBuilder
Constants ¶
const ( // CommentID is the ID for the test GitHub comment. CommentID = 117 // IssueNumber is number for the test GitHub issue. IssueNumber = 42 // Repository is the GitHub test repository name. Repository = "repository" // Username is the GitHub test username. Username = "icecrime" )
Variables ¶
var CommitSHA = []string{"d34db33f", "badc0ff33"}
CommitSHA is an array of arbitrary Git SHA for testing purpose.
Functions ¶
func AssertExpectations ¶
AssertExpectations asserts mock expectations for all different GitHub services.
func MakeStatus ¶
func MakeStatus(context, status string, createdAt time.Time) *github.RepoStatus
MakeStatus is a helper to create a GitHub repository status.
Types ¶
type Client ¶
type Client struct { MockIssues mocks.IssuesService MockPullRequests mocks.PullRequestsService MockRepositories mocks.RepositoriesService MockSearch mocks.SearchService }
Client is a mocked implementation of a GitHub client.
func (*Client) Issues ¶
func (t *Client) Issues() gh.IssuesService
Issues returns the issue service instance.
func (*Client) PullRequests ¶
func (t *Client) PullRequests() gh.PullRequestsService
PullRequests returns the pull request service instance.
func (*Client) Repositories ¶
func (t *Client) Repositories() gh.RepositoriesService
Repositories returns the repository service instance.
func (*Client) Search ¶
func (t *Client) Search() gh.SearchService
Search returns the search service instance.
type IssueBuilder ¶
IssueBuilder is a helper type to generate an issue object.
func NewIssueBuilder ¶
func NewIssueBuilder(number int) *IssueBuilder
NewIssueBuilder returns a new IssueBuilder instance.
func (*IssueBuilder) Body ¶
func (p *IssueBuilder) Body(body string) *IssueBuilder
Body sets the body attribute of the issue.
func (*IssueBuilder) Item ¶
func (p *IssueBuilder) Item() gh.Item
Item returns the the underlying issue as an item.
func (*IssueBuilder) Labels ¶
func (p *IssueBuilder) Labels(names []string) *IssueBuilder
Labels sets the labels of the issue.
func (*IssueBuilder) Number ¶
func (p *IssueBuilder) Number(number int) *IssueBuilder
Number sets the number of the issue.
func (*IssueBuilder) Title ¶
func (p *IssueBuilder) Title(title string) *IssueBuilder
Title sets the title of the pull request.
func (*IssueBuilder) UserLogin ¶
func (p *IssueBuilder) UserLogin(title string) *IssueBuilder
UserLogin sets the user of the pull request.
type PullRequestBuilder ¶
type PullRequestBuilder struct {
Value *github.PullRequest
}
PullRequestBuilder is a helper type to generate a pull request object.
func NewPullRequestBuilder ¶
func NewPullRequestBuilder(number int) *PullRequestBuilder
NewPullRequestBuilder returns a new PullRequestBuilder instance.
func (*PullRequestBuilder) BaseBranch ¶
func (p *PullRequestBuilder) BaseBranch(username, repository, ref string, SHA string) *PullRequestBuilder
BaseBranch sets the Base attribute of the pull request.
func (*PullRequestBuilder) Body ¶
func (p *PullRequestBuilder) Body(body string) *PullRequestBuilder
Body sets the body attribute of the pull request.
func (*PullRequestBuilder) Commits ¶
func (p *PullRequestBuilder) Commits(commits int) *PullRequestBuilder
Commits sets the commits objects of the pull request.
func (*PullRequestBuilder) HeadBranch ¶
func (p *PullRequestBuilder) HeadBranch(username, repository, ref string, SHA string) *PullRequestBuilder
HeadBranch sets the Head attribute of the pull request.
func (*PullRequestBuilder) Item ¶
func (p *PullRequestBuilder) Item() gh.Item
Item returns the the underlying pull request as an item.
func (*PullRequestBuilder) Merged ¶
func (p *PullRequestBuilder) Merged(merged bool) *PullRequestBuilder
Merged sets the Merge attribute of the pull request.
func (*PullRequestBuilder) Number ¶
func (p *PullRequestBuilder) Number(number int) *PullRequestBuilder
Number sets the number of the pull request.
func (*PullRequestBuilder) State ¶
func (p *PullRequestBuilder) State(state string) *PullRequestBuilder
State sets the state of the pull request.
func (*PullRequestBuilder) Title ¶
func (p *PullRequestBuilder) Title(title string) *PullRequestBuilder
Title sets the title of the pull request.
func (*PullRequestBuilder) UserLogin ¶
func (p *PullRequestBuilder) UserLogin(title string) *PullRequestBuilder
UserLogin sets the user of the pull request.