Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Commit

Permalink
now with less printlns and more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Nov 10, 2019
1 parent 812232a commit 794943f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions here/dir.go
Expand Up @@ -2,7 +2,6 @@ package here

import (
"encoding/json"
"fmt"
"os"
"path/filepath"
)
Expand Down Expand Up @@ -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,
Dir: dir,
Name: filepath.Base(dir),
}

b, err := run("go", "list", "-json", "-m")
Expand Down
7 changes: 6 additions & 1 deletion here/dir_test.go
Expand Up @@ -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)

})
}
}
1 change: 0 additions & 1 deletion pkging/pkgtest/ref.go
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion pkging/pkgtest/testdata/ref/go.mod
Expand Up @@ -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 => ../../../../

0 comments on commit 794943f

Please sign in to comment.