testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitTestSuite

type GitTestSuite struct {
	suite.Suite

	Verbose     bool
	GitUndoHook bool
	// contains filtered or unexported fields
}

GitTestSuite provides a test environment for git operations.

func (*GitTestSuite) AssertBranchExists

func (s *GitTestSuite) AssertBranchExists(branch string)

AssertBranchExists checks if a branch exists.

func (*GitTestSuite) AssertBranchNotExists

func (s *GitTestSuite) AssertBranchNotExists(branch string)

AssertBranchNotExists checks if a branch doesn't exist.

func (*GitTestSuite) AssertFileExists

func (s *GitTestSuite) AssertFileExists(name string)

AssertFileExists checks if a file exists in the repository.

func (*GitTestSuite) AssertFileNotExists

func (s *GitTestSuite) AssertFileNotExists(name string)

AssertFileNotExists checks if a file doesn't exist in the repository.

func (*GitTestSuite) CreateFile

func (s *GitTestSuite) CreateFile(name, content string)

CreateFile creates a file in the repository with the given content.

func (*GitTestSuite) GetRepoDir

func (s *GitTestSuite) GetRepoDir() string

GetRepoDir returns the test repository directory.

func (*GitTestSuite) Git

func (s *GitTestSuite) Git(args ...string)

Git runs a git command in the test repository.

func (*GitTestSuite) RunCmd

func (s *GitTestSuite) RunCmd(cmd string, args ...string) string

RunCmd executes a command in the test repository.

func (*GitTestSuite) RunCmdWithEnv

func (s *GitTestSuite) RunCmdWithEnv(extraEnv []string, cmd string, args ...string) string

RunCmdWithEnv executes a command with additional environment variables.

func (*GitTestSuite) SetApplication

func (s *GitTestSuite) SetApplication(app GitUndoApp)

SetApplication sets the application instance for the test suite.

func (*GitTestSuite) SetupSuite

func (s *GitTestSuite) SetupSuite()

SetupSuite creates a temporary directory and initializes a git repository.

func (*GitTestSuite) TearDownSuite

func (s *GitTestSuite) TearDownSuite()

TearDownSuite cleans up the temporary directory.

type GitUndoApp

type GitUndoApp interface {
	Run(ctx context.Context, opts app.RunOptions) error
}

Jump to

Keyboard shortcuts

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