gittest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git igit.Git

Git is a type that represents an instance of the Git version control system. It provides methods for executing Git commands and asserting the state of the repository.

func (Git) AssertBranch

func (g Git) AssertBranch(t *testing.T, branch string)

AssertBranch asserts that the current branch of a Git repository matches the given branch name testing.T.

func (Git) AssertBranchPrefix

func (g Git) AssertBranchPrefix(t *testing.T, prefix string)

AssertBranchPrefix asserts that the current Git branch has the specified prefix. It takes a testing.T instance and a string as arguments. If the prefix is not found in the current branch name, AssertBranchPrefix will fail the test with a descriptive error message.

func (Git) AssertCommit

func (g Git) AssertCommit(t *testing.T, c git.Commit)

AssertCommit asserts that the last commit message matches the provided `git.Commit`. It takes a `*testing.T` and a `git.Commit` as arguments. If the assertion fails, it will fail the test.

func (Git) Cmd

func (g Git) Cmd(args ...string) (*exec.Cmd, []byte, error)

Cmd returns a *exec.Cmd that can be used to execute Git commands and captures the command's output. It takes a variadic list of strings, which are passed as arguments to the Git command. This method is a part of type Git igit.Git in the gittest package gittest.

Jump to

Keyboard shortcuts

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