test

package
v0.1.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GIT_USERNAME = "Alice"
	GIT_EMAIL    = "alice@ecorp.com"
)

Variables

This section is empty.

Functions

func CaptureStd

func CaptureStd(t *testing.T, std *os.File) (f *os.File, reset func())

func CleanupRepo

func CleanupRepo(t *testing.T, r *git.Repository)

CleanupRepo removes the repo directory recursively

func InitRepoConf

func InitRepoConf(t *testing.T, r *git.Repository)

InitRepoConf set the repository initial configuration

func NewFile

func NewFile(t *testing.T, r *git.Repository) *os.File

NewFile creates a new temp file in the repo working directory

func StageFile

func StageFile(t *testing.T, f *os.File, r *git.Repository)

StageFile adds a file to the repository index

func StageNewFile

func StageNewFile(t *testing.T, r *git.Repository)

StageNewFile creates a new file and adds it to the index

func TestRepo

func TestRepo(t *testing.T) (repo *git.Repository)

TestRepo creates a new repository in a temporary directory

func WriteGitHook

func WriteGitHook(t *testing.T, hook string, content string)

Types

type Clock

type Clock struct {
	Value time.Time
}

Clock is a clock that returns always the same value

func (Clock) Now

func (c Clock) Now() time.Time

Now returns the Clock value

Jump to

Keyboard shortcuts

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