Skip to content

Commit

Permalink
v2 (but in name only cause modules) (#38)
Browse files Browse the repository at this point in the history
* v2 (but in name only cause modules)

* now with less deps
  • Loading branch information
markbates authored Dec 24, 2019
1 parent 46253f7 commit 530825d
Show file tree
Hide file tree
Showing 80 changed files with 201 additions and 1,317 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/release.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .goreleaser.yml

This file was deleted.

14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
TAGS ?= ""
GO_BIN ?= "go"

install: packr
go install -tags ${TAGS} -v ./genny
make tidy

tidy:
go mod tidy

build: packr
go build -v .
make tidy

test: packr
test:
go test -cover -tags ${TAGS} ./...
make tidy

packr:
packr2
make tidy
29 changes: 0 additions & 29 deletions depgen/ensure.go

This file was deleted.

28 changes: 0 additions & 28 deletions depgen/init.go

This file was deleted.

63 changes: 0 additions & 63 deletions depgen/init_test.go

This file was deleted.

22 changes: 0 additions & 22 deletions depgen/install.go

This file was deleted.

42 changes: 0 additions & 42 deletions depgen/install_test.go

This file was deleted.

28 changes: 0 additions & 28 deletions depgen/update.go

This file was deleted.

4 changes: 0 additions & 4 deletions depgen/version.go

This file was deleted.

34 changes: 28 additions & 6 deletions disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package genny_test
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"

"github.com/gobuffalo/genny"
"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/genny/v2"
"github.com/gobuffalo/packd"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -68,10 +71,10 @@ func Test_Disk_Find_FromDisk(t *testing.T) {
run := genny.DryRunner(context.Background())

d := run.Disk
f, err := d.Find("fixtures/foo.txt")
f, err := d.Find("internal/testdata/foo.txt")
r.NoError(err)

exp, err := ioutil.ReadFile("./fixtures/foo.txt")
exp, err := ioutil.ReadFile("./internal/testdata/foo.txt")
r.NoError(err)

act, err := ioutil.ReadAll(f)
Expand All @@ -92,11 +95,30 @@ func Test_Disk_FindFile_DoesntExist(t *testing.T) {
func Test_Disk_AddBox(t *testing.T) {
r := require.New(t)

box := packr.New("./fixtures", "./fixtures")
box := packd.NewMemoryBox()

td := filepath.Join("internal", "testdata")
err := filepath.Walk(td, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if info.IsDir() {
return nil
}

b, err := ioutil.ReadFile(path)
if err != nil {
return err
}
p := strings.TrimPrefix(path, td+string(filepath.Separator))
box.AddBytes(p, b)

return nil
})

run := genny.DryRunner(context.Background())
d := run.Disk
err := d.AddBox(box)
err = d.AddBox(box)
r.NoError(err)

f, err := d.Find("foo.txt")
Expand Down
1 change: 0 additions & 1 deletion example_test.go

This file was deleted.

Loading

0 comments on commit 530825d

Please sign in to comment.