Documentation
¶
Overview ¶
Package testutil provides test utilities for git-this-bread tests.
Index ¶
- func CaptureStdout(fn func()) string
- type TestRepo
- func (r *TestRepo) AddRemote(name, url string)
- func (r *TestRepo) Checkout(name string)
- func (r *TestRepo) Commit(message string)
- func (r *TestRepo) CommitAs(message, email, name string)
- func (r *TestRepo) CreateBranch(name string)
- func (r *TestRepo) Git(args ...string) string
- func (r *TestRepo) GitMayFail(args ...string) (string, error)
- func (r *TestRepo) Stage(name string)
- func (r *TestRepo) Stash()
- func (r *TestRepo) WriteFile(name, content string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureStdout ¶
func CaptureStdout(fn func()) string
CaptureStdout captures stdout during the execution of fn.
Types ¶
type TestRepo ¶
type TestRepo struct {
Path string
// contains filtered or unexported fields
}
TestRepo is a helper for creating temporary git repositories in tests.
func NewTestRepo ¶
NewTestRepo creates a new temporary git repository and registers cleanup.
func (*TestRepo) CommitAs ¶
CommitAs stages all changes and creates a commit as the specified author.
func (*TestRepo) CreateBranch ¶
CreateBranch creates a new branch.
func (*TestRepo) GitMayFail ¶
GitMayFail runs a git command that may fail, returning output and error.
Click to show internal directories.
Click to hide internal directories.