now with less printlns and more tests

This commit is contained in:
Mark Bates 2019-11-10 18:27:57 -05:00
parent 812232aaff
commit 794943f042
5 changed files with 13 additions and 7 deletions

View File

@ -17,7 +17,7 @@ build: tidy
make tidy
test: tidy
$(GO_BIN) test -cover -tags ${TAGS} -timeout 5s ./...
$(GO_BIN) test -count 1 -cover -tags ${TAGS} -timeout 10s ./...
make tidy
cov:

View File

@ -2,7 +2,6 @@ package here
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
)
@ -93,9 +92,9 @@ func dir(p string) (Info, error) {
}
func fromNonGoDir(dir string) (Info, error) {
fmt.Println(">>>TODO here/dir.go:59: dir ", dir)
i := Info{
Dir: dir,
Name: filepath.Base(dir),
}
b, err := run("go", "list", "-json", "-m")

View File

@ -49,13 +49,18 @@ func Test_Dir(t *testing.T) {
t.Run(tt.in, func(st *testing.T) {
r := require.New(st)
_, err = here.Dir(tt.in)
info, err := here.Dir(tt.in)
if tt.err {
r.Error(err)
return
}
r.NoError(err)
r.NotZero(info)
r.NotZero(info.Dir)
r.NotZero(info.Name)
r.NotZero(info.Module)
})
}
}

View File

@ -17,7 +17,6 @@ type Ref struct {
}
func NewRef() (*Ref, error) {
here.ClearCache()
her, err := here.Package("github.com/markbates/pkger")
if err != nil {
return nil, err

View File

@ -2,6 +2,9 @@ module app
go 1.13
require github.com/markbates/pkger v0.0.0
require (
github.com/gobuffalo/buffalo v0.15.0 // indirect
github.com/markbates/pkger v0.0.0
)
replace github.com/markbates/pkger => ../../../../