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) }
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) }
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) }
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()) }
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() } }
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)) }