Files
athens/pkg/repo/github/github_test.go
marpio 8ceda38ad7 replace fs operations with afero (#123)
* replace fs operations with afero

* fix goget test

* fix test

* fix test again...

* remove empty lines

* fix merge

setupTmp - return 3, not 2 values

* just to start new travis build

got The command "go get github.com/golang/lint/golint" failed and exited with 1 during . I hope it was a temp problem.
2018-05-13 12:40:09 -07:00

51 lines
813 B
Go

package github
import (
"path/filepath"
"testing"
"github.com/spf13/afero"
)
func Test_Download(t *testing.T) {
owner := "bketelsen"
repo := "captainhook"
version := "v0.1.8"
memFs := afero.NewMemMapFs()
fetcher, err := NewGitFetcher(memFs, owner, repo, version)
if err != nil {
t.Error(err)
}
path, err := fetcher.Fetch()
if err != nil {
t.Error(err)
}
if path == "" {
t.Error("path null")
}
t.Log(path)
if _, err := memFs.Stat(filepath.Join(path, version+".mod")); err != nil {
t.Error(err)
t.Fail()
}
if _, err := memFs.Stat(filepath.Join(path, version+".zip")); err != nil {
t.Error(err)
t.Fail()
}
if _, err := memFs.Stat(filepath.Join(path, version+".info")); err != nil {
t.Error(err)
t.Fail()
}
err = fetcher.Clear()
if err != nil {
t.Error(err)
}
}