Documentation
¶
Index ¶
- type GitTestSuite
- func (s *GitTestSuite) AssertBranchExists(branch string)
- func (s *GitTestSuite) AssertBranchNotExists(branch string)
- func (s *GitTestSuite) AssertFileExists(name string)
- func (s *GitTestSuite) AssertFileNotExists(name string)
- func (s *GitTestSuite) CreateFile(name, content string)
- func (s *GitTestSuite) GetRepoDir() string
- func (s *GitTestSuite) Git(args ...string)
- func (s *GitTestSuite) RunCmd(cmd string, args ...string) string
- func (s *GitTestSuite) RunCmdWithEnv(extraEnv []string, cmd string, args ...string) string
- func (s *GitTestSuite) SetApplication(app GitUndoApp)
- func (s *GitTestSuite) SetupSuite()
- func (s *GitTestSuite) TearDownSuite()
- type GitUndoApp
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
}