Documentation ¶
Index ¶
- Constants
- func AddSubDirKaeterMock(t *testing.T, testFolder, modulePath, versionsYAML string) (moduleFolder, commitHash string)
- func CommitFileAndGetHash(t *testing.T, repoPath, filename, fileContent, commitMessage string) string
- func CreateMockFile(t *testing.T, tmpPath, filename, content string)
- func CreateMockKaeterRepo(t *testing.T, makefileContent, commitMessage, versionsYAML string) string
- func CreateMockRepo(t *testing.T) (folder, commitHash string)
- func CreateTmpFolder(t *testing.T) string
- func SwitchToNewBranch(t *testing.T, repoPath, branchName string)
Constants ¶
const EmptyMakefileContent = ".PHONY: build test snapshot release"
EmptyMakefileContent is the content of the minimal Makefile, used for testing
const EmptyVersionsAlternateYAML = `id: ch.open.kaeter:unit-testing
type: Makefile
versioning: SemVer
versions:
0.0.0: 1970-01-01T00:00:00Z|INIT`
EmptyVersionsAlternateYAML is a minimal kaeter versions file content with a differen module id
const EmptyVersionsYAML = `id: ch.open.kaeter:unit-test
type: Makefile
versioning: SemVer
versions:
0.0.0: 1970-01-01T00:00:00Z|INIT`
EmptyVersionsYAML is the content of a minimal kaeter versions file, used for testing
Variables ¶
This section is empty.
Functions ¶
func AddSubDirKaeterMock ¶
func AddSubDirKaeterMock(t *testing.T, testFolder, modulePath, versionsYAML string) (moduleFolder, commitHash string)
AddSubDirKaeterMock is a test helper to create a mock kaeter module in a tmp fodler it returns the path to the tmp folder. Caller is responsible for deleting it.
func CommitFileAndGetHash ¶
func CommitFileAndGetHash(t *testing.T, repoPath, filename, fileContent, commitMessage string) string
CommitFileAndGetHash wrapper around git add and git commit, returns the hash of commit.
func CreateMockFile ¶
CreateMockFile creates file with content in a tmp folder
func CreateMockKaeterRepo ¶
CreateMockKaeterRepo is a test helper to create a mock kaeter module in a tmp fodler it returns the path to the tmp folder. Caller is responsible for deleting it.
func CreateMockRepo ¶
CreateMockRepo initializes a mock git repository in a tmp folder
func CreateTmpFolder ¶
CreateTmpFolder returns path to new temp folder for testing
func SwitchToNewBranch ¶
SwitchToNewBranch wrapper around git switch -c branchName
Types ¶
This section is empty.