mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-24 04:16:27 +02:00
more tests
This commit is contained in:
parent
2885b24976
commit
1ee7fafe96
@ -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))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user