Пример #1
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)
}
Пример #2
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)
}
Пример #3
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)
}
Пример #4
0
func TestBundleAndUpdate(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	a := antibody.New([]bundle.Bundle{
		bundle.New("caarlos0/zsh-pg", home),
		bundle.New("caarlos0/zsh-open-pr", home),
	})
	a.Download()
	a.Update()
	internal.AssertFileCount(t, 2, home)
}