diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index ba8afb6..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,81 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/davecgh/go-spew" - packages = ["spew"] - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - name = "github.com/fatih/color" - packages = ["."] - revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4" - version = "v1.7.0" - -[[projects]] - name = "github.com/mattn/go-colorable" - packages = ["."] - revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" - version = "v0.0.9" - -[[projects]] - name = "github.com/mattn/go-isatty" - packages = ["."] - revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39" - version = "v0.0.3" - -[[projects]] - name = "github.com/mattn/go-shellwords" - packages = ["."] - revision = "02e3cf038dcea8290e44424da473dd12be796a8a" - version = "v1.0.3" - -[[projects]] - branch = "master" - name = "github.com/mattn/go-zglob" - packages = [ - ".", - "fastwalk" - ] - revision = "49693fbb3fe3c3a75fc4e4d6fb1d7cedcbdeb385" - -[[projects]] - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - name = "github.com/stretchr/objx" - packages = ["."] - revision = "477a77ecc69700c7cdeb1fa9e129548e1c1c393c" - version = "v0.1.1" - -[[projects]] - name = "github.com/stretchr/testify" - packages = [ - "assert", - "mock" - ] - revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" - version = "v1.2.2" - -[[projects]] - name = "github.com/urfave/cli" - packages = ["."] - revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" - version = "v1.20.0" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix"] - revision = "6c888cc515d3ed83fc103cf1d84468aad274b0a7" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "8446ff85ebcb6bc802d3f444727c3910444a405f3c073c1095eb5cc8c497138b" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index dd94821..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,23 +0,0 @@ -[[constraint]] - name = "github.com/fatih/color" - version = "1.7.0" - -[[constraint]] - name = "github.com/mattn/go-shellwords" - version = "1.0.3" - -[[constraint]] - name = "github.com/urfave/cli" - version = "1.20.0" - -[prune] - go-tests = true - unused-packages = true - -[[constraint]] - branch = "master" - name = "github.com/mattn/go-zglob" - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.2.2" diff --git a/builder_test.go b/builder_test.go index 4abcfeb..4ea52d9 100644 --- a/builder_test.go +++ b/builder_test.go @@ -38,13 +38,11 @@ func TestBuilderFailureBuild(t *testing.T) { t.Fatalf("couldn't get current working directory: %v", err) } - absPathBuild := filepath.Join(wd, dir) - b := NewBuilder(dir, bin, wd, bArgs) err = b.Build() assert.NotNil(t, err, "build error") assert.Equal(t, err.Error(), "build failed with exit status 2\n"+ - "# _"+absPathBuild+"\n"+ + "# github.com/maxcnunes/gaper/testdata/build-failure\n"+ "./main.go:4:6: func main must have no arguments and no return values\n"+ "./main.go:5:1: missing return at end of function\n") } diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b4e5c0d --- /dev/null +++ b/go.mod @@ -0,0 +1,17 @@ +module github.com/maxcnunes/gaper + +go 1.13 + +require ( + github.com/davecgh/go-spew v1.1.0 + github.com/fatih/color v1.7.0 + github.com/mattn/go-colorable v0.0.9 + github.com/mattn/go-isatty v0.0.3 + github.com/mattn/go-shellwords v1.0.3 + github.com/mattn/go-zglob v0.0.0-20180607075734-49693fbb3fe3 + github.com/pmezard/go-difflib v1.0.0 + github.com/stretchr/objx v0.1.1 + github.com/stretchr/testify v1.2.2 + github.com/urfave/cli v1.20.0 + golang.org/x/sys v0.0.0-20180616030259-6c888cc515d3 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..b3740de --- /dev/null +++ b/go.sum @@ -0,0 +1,21 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-shellwords v1.0.3 h1:K/VxK7SZ+cvuPgFSLKi5QPI9Vr/ipOf4C1gN+ntueUk= +github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= +github.com/mattn/go-zglob v0.0.0-20180607075734-49693fbb3fe3 h1:GWnsQiFbiQ7lREZbKkiJC6xxbymvny8GKtpdkPxjB6o= +github.com/mattn/go-zglob v0.0.0-20180607075734-49693fbb3fe3/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +golang.org/x/sys v0.0.0-20180616030259-6c888cc515d3/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/watcher_test.go b/watcher_test.go index 73f701a..9aaa556 100644 --- a/watcher_test.go +++ b/watcher_test.go @@ -1,7 +1,6 @@ package gaper import ( - "log" "os" "path/filepath" "runtime" @@ -173,6 +172,11 @@ func TestWatcherIgnoreFile(t *testing.T) { }, } + // create vendor folder for testing + if err := os.MkdirAll("vendor", os.ModePerm); err != nil { + t.Fatal(err) + } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { srvdir := "." @@ -198,12 +202,12 @@ func TestWatcherIgnoreFile(t *testing.T) { filePath := tc.file file, err := os.Open(filePath) if err != nil { - log.Fatal(err) + t.Fatal(err) } fileInfo, err := file.Stat() if err != nil { - log.Fatal(err) + t.Fatal(err) } assert.Equal(t, tc.expectIgnore, wt.ignoreFile(filePath, fileInfo))