mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-15 11:56:56 +02:00
more tests
This commit is contained in:
parent
03bae3d4da
commit
652f57ef2e
32
pipeline/env/env_test.go
vendored
Normal file
32
pipeline/env/env_test.go
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package env
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"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 TestValidEnv(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
var ctx = &context.Context{
|
||||||
|
Config: config.Project{},
|
||||||
|
}
|
||||||
|
assert.NoError(Pipe{}.Run(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestInvalidEnv(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
os.Unsetenv("GITHUB_TOKEN")
|
||||||
|
var ctx = &context.Context{
|
||||||
|
Config: config.Project{},
|
||||||
|
}
|
||||||
|
assert.Error(Pipe{}.Run(ctx))
|
||||||
|
}
|
@ -8,6 +8,10 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestDescription(t *testing.T) {
|
||||||
|
assert.NotEmpty(t, Pipe{}.Description())
|
||||||
|
}
|
||||||
|
|
||||||
func TestValidVersion(t *testing.T) {
|
func TestValidVersion(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user