Пример #1
0
func TestGetsRepoInfo(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	repo := git.NewGithubRepo("caarlos0/zsh-pg", home)
	assert.Equal(t, "caarlos0/zsh-pg", repo.Name())
	assert.Equal(t, home+"caarlos0-zsh-pg", repo.Folder())
}
Пример #2
0
func TestUpdatesUnexistentRepo(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	repo := git.NewGithubRepo("doesn-not-exist-really", home)
	assert.Error(t, repo.Update())
	internal.AssertFileCount(t, 0, home)
}
Пример #3
0
func TestClonesRepo(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	repo := git.NewGithubRepo("caarlos0/env", home)
	assert.NoError(t, repo.Download())
	internal.AssertFileCount(t, 1, home)
}
Пример #4
0
func TestCloneDoesNothingIfFolderAlreadyExists(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	repo := git.NewGithubRepo("caarlos0/zsh-add-upstream", home)
	assert.NoError(t, repo.Download())
	assert.NoError(t, repo.Download())
	internal.AssertFileCount(t, 1, home)
}
Пример #5
0
// New creates a new bundle instance
func New(fullName, folder string) Bundle {
	return Bundle{git.NewGithubRepo(fullName, folder)}
}