1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-13 11:50:34 +02:00

more tests

This commit is contained in:
Carlos Alexandro Becker 2017-03-25 20:40:45 -03:00
parent 03bae3d4da
commit 652f57ef2e
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 36 additions and 0 deletions

32
pipeline/env/env_test.go vendored Normal file
View 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))
}

View File

@ -8,6 +8,10 @@ import (
"github.com/stretchr/testify/assert"
)
func TestDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.Description())
}
func TestValidVersion(t *testing.T) {
assert := assert.New(t)