Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StubGitRepository ¶
Types ¶
type Client ¶
client implements GitClient
func (*Client) CreateBranchWithCheckout ¶
CreateBranchWithCheckout creates a new branch in current directory and does a checkout to that branch. All local changes will be preserved. If current directory is not a git repo, error is returned
type GitClientMock ¶
type GitClientMock struct { // CreateBranchWithCheckoutFunc mocks the CreateBranchWithCheckout method. CreateBranchWithCheckoutFunc func(s string) error // contains filtered or unexported fields }
GitClientMock is a mock implementation of GitClient.
func TestSomethingThatUsesGitClient(t *testing.T) { // make and configure a mocked GitClient mockedGitClient := &GitClientMock{ CreateBranchWithCheckoutFunc: func(s string) error { panic("mock out the CreateBranchWithCheckout method") }, } // use mockedGitClient in code that requires GitClient // and then make assertions. }
func NewGitClientMock ¶
func NewGitClientMock() *GitClientMock
func (*GitClientMock) CreateBranchWithCheckout ¶
func (mock *GitClientMock) CreateBranchWithCheckout(s string) error
CreateBranchWithCheckout calls CreateBranchWithCheckoutFunc.
func (*GitClientMock) CreateBranchWithCheckoutCalls ¶
func (mock *GitClientMock) CreateBranchWithCheckoutCalls() []struct { S string }
CreateBranchWithCheckoutCalls gets all the calls that were made to CreateBranchWithCheckout. Check the length with:
len(mockedGitClient.CreateBranchWithCheckoutCalls())
Click to show internal directories.
Click to hide internal directories.