mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
more tests
This commit is contained in:
parent
2885b24976
commit
1ee7fafe96
@ -1,11 +1,36 @@
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/goreleaser/goreleaser/config"
|
||||||
|
"github.com/goreleaser/goreleaser/context"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDescription(t *testing.T) {
|
func TestDescription(t *testing.T) {
|
||||||
assert.NotEmpty(t, Pipe{}.Description())
|
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