From 12501bdfffb7831f48c885526e1bb1a8c1a744bf Mon Sep 17 00:00:00 2001 From: Southclaws Date: Sat, 10 Feb 2018 13:37:22 +0000 Subject: [PATCH] add: more scoop unit tests --- pipeline/scoop/scoop_test.go | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pipeline/scoop/scoop_test.go b/pipeline/scoop/scoop_test.go index 7ae59be06..522d8ae76 100644 --- a/pipeline/scoop/scoop_test.go +++ b/pipeline/scoop/scoop_test.go @@ -11,9 +11,47 @@ import ( "github.com/goreleaser/goreleaser/context" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/client" + "github.com/goreleaser/goreleaser/internal/testlib" "github.com/stretchr/testify/assert" ) +func TestDescription(t *testing.T) { + assert.NotEmpty(t, Pipe{}.String()) +} + +func TestDefault(t *testing.T) { + _, back := testlib.Mktmp(t) + defer back() + + var ctx = &context.Context{ + Config: config.Project{ + Builds: []config.Build{ + { + Binary: "foo", + Goos: []string{"linux", "darwin"}, + Goarch: []string{"386", "amd64"}, + }, + { + Binary: "bar", + Goos: []string{"linux", "darwin"}, + Goarch: []string{"386", "amd64"}, + Ignore: []config.IgnoredBuild{ + {Goos: "darwin", Goarch: "amd64"}, + }, + }, + { + Binary: "foobar", + Goos: []string{"linux"}, + Goarch: []string{"amd64"}, + }, + }, + }, + } + assert.NoError(t, Pipe{}.Default(ctx)) + assert.NotEmpty(t, ctx.Config.Scoop.CommitAuthor.Name) + assert.NotEmpty(t, ctx.Config.Scoop.CommitAuthor.Email) +} + func Test_buildManifest(t *testing.T) { type args struct { ctx *context.Context