Skip to content

Commit

Permalink
test amendments
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Ranson committed Jul 20, 2023
1 parent 02b6593 commit 75446c0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 0 additions & 10 deletions cmd/clone/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ func run(c *cobra.Command, _ []string) {
}
createBranchActivity.EndWithSuccess()

// pull from upstream
// if !nofork
// check main or master
// pullactivity = logger.StartActivity(etc)
// err = g / gh . pull branch
// if err != nil, error and break, endwithfailure
// pullactivity.endwithsuccess.

// then add a test or two

if nofork {
doneCount++
continue
Expand Down
7 changes: 7 additions & 0 deletions internal/git/fake_git.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ func (f *FakeGit) Push(output io.Writer, workingDir string, _ string, branchName
return err
}

func (f *FakeGit) Pull(output io.Writer, workingDir string, remote string, branchName string) error {
call := []string{"pull", "--ff-only", workingDir, remote, branchName}
f.calls = append(f.calls, call)
_, err := f.handler(output, call)
return err
}

func (f *FakeGit) AssertCalledWith(t *testing.T, expected [][]string) {
assert.Equal(t, expected, f.calls)
}
Expand Down
6 changes: 6 additions & 0 deletions internal/github/fake_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ func (f *FakeGitHub) GetPR(output io.Writer, workingDir string, _ string) (*PrSt
return result.(*PrStatus), err
}

func (f *FakeGitHub) GetDefaultBranchName(output io.Writer, workingDir string, fullRepoName string) (string, error) {
f.calls = append(f.calls, []string{workingDir, fullRepoName})
_, err := f.handler(output, workingDir, fullRepoName)
return "", err
}

func (f *FakeGitHub) AssertCalledWith(t *testing.T, expected [][]string) {
assert.Equal(t, expected, f.calls)
}
Expand Down

0 comments on commit 75446c0

Please sign in to comment.