1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00

Merge branch 'master' into ldflags

This commit is contained in:
Carlos Alexandro Becker 2017-03-25 20:49:29 -03:00
commit 7739a944db
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
6 changed files with 73 additions and 0 deletions

View File

@ -7,6 +7,10 @@ import (
"github.com/stretchr/testify/assert"
)
func TestDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.Description())
}
func TestNameWithDash(t *testing.T) {
assert.Equal(t, formulaNameFor("some-binary"), "SomeBinary")
}

View File

@ -9,6 +9,10 @@ import (
"github.com/stretchr/testify/assert"
)
func TestPipeDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.Description())
}
func TestRun(t *testing.T) {
assert.NoError(t, run(runtime.GOOS, runtime.GOARCH, []string{"go", "list", "./..."}))
}

View File

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

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

25
pipeline/git/git_test.go Normal file
View File

@ -0,0 +1,25 @@
package git
import (
"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 TestValidVersion(t *testing.T) {
assert := assert.New(t)
var ctx = &context.Context{
Config: config.Project{},
}
assert.NoError(Pipe{}.Run(ctx))
assert.NotEmpty(ctx.Git.CurrentTag)
assert.NotEmpty(ctx.Git.PreviousTag)
assert.NotEmpty(ctx.Git.Diff)
}

View File

@ -7,6 +7,10 @@ import (
"github.com/stretchr/testify/assert"
)
func TestPipeDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.Description())
}
func TestDescription(t *testing.T) {
assert := assert.New(t)
desc := description("0abf342 some message")