From 1ee7fafe96465e59a89420564e484b4b41838fc0 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 25 Mar 2017 20:54:14 -0300 Subject: [PATCH] more tests --- pipeline/build/build_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pipeline/build/build_test.go b/pipeline/build/build_test.go index 5636f5d29..fd82e070f 100644 --- a/pipeline/build/build_test.go +++ b/pipeline/build/build_test.go @@ -1,11 +1,36 @@ package build import ( + "runtime" "testing" + "github.com/goreleaser/goreleaser/config" + "github.com/goreleaser/goreleaser/context" "github.com/stretchr/testify/assert" ) func TestDescription(t *testing.T) { assert.NotEmpty(t, Pipe{}.Description()) } + +func TestRun(t *testing.T) { + assert.NoError(t, run(runtime.GOOS, runtime.GOARCH, []string{"go", "list", "./..."})) +} + +func TestRunInvalidCommand(t *testing.T) { + assert.Error(t, run(runtime.GOOS, runtime.GOARCH, []string{"gggggo", "nope"})) +} + +func TestBuild(t *testing.T) { + assert := assert.New(t) + var config = config.Project{ + Build: config.Build{ + Binary: "testing", + Flags: "-n", + }, + } + var ctx = &context.Context{ + Config: config, + } + assert.NoError(build("build_test", runtime.GOOS, runtime.GOARCH, ctx)) +}