1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

more tests

This commit is contained in:
Carlos Alexandro Becker 2017-03-25 20:54:14 -03:00
parent 2885b24976
commit 1ee7fafe96
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -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))
}