Пример #1
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)
}
Пример #2
0
func TestSourceablesZshTheme(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	b := bundle.New("caiogondim/bullet-train-oh-my-zsh-theme", home)
	b.Download()
	assert.Len(t, b.Sourceables(), 1)
}
Пример #3
0
func TestSourceablesDotSh(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	b := bundle.New("rupa/z", home)
	b.Download()
	assert.Len(t, b.Sourceables(), 1)
}
Пример #4
0
func TestBundleSourceables(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	b := bundle.New("caarlos0/zsh-pg", home)
	b.Download()
	assert.NotEmpty(t, b.Sourceables())
}
Пример #5
0
func doBundle(ctx *cli.Context) {
	if readFromStdin() {
		entries, _ := ioutil.ReadAll(os.Stdin)
		antibody.New(
			bundle.Parse(string(entries), antibody.Home()),
		).Download()
	} else {
		antibody.New(
			[]bundle.Bundle{bundle.New(ctx.Args().First(), antibody.Home())},
		).Download()
	}
}
Пример #6
0
func TestList(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	bundle.New("caarlos0/zsh-pg", home).Download()
	assert.NotEmpty(t, bundle.List(home))
}