1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00
Carlos Alexandro Becker 64b1f14a86
refactor: better code organization (#757)
* refactor: merging archive in the same repo

* refactor: merging archive in the same repo

* refactor: better organizing packages

* refactor: fixing renames

* fix: new dep version

* fix: makefile

* fix: zip/tar tests

* fix: gitigonore

* fix: s3 tests

* fix: archive test
2018-08-14 23:50:20 -03:00

47 lines
761 B
Go

package before
import (
"testing"
"github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context"
"github.com/stretchr/testify/assert"
)
func TestDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.String())
}
func TestRunPipe(t *testing.T) {
for _, tc := range [][]string{
nil,
{},
{"go version"},
{"go version", "go list"},
} {
ctx := context.New(
config.Project{
Before: config.Before{
Hooks: tc,
},
},
)
assert.NoError(t, Pipe{}.Run(ctx))
}
}
func TestRunPipeFail(t *testing.T) {
for _, tc := range [][]string{
{"go tool foobar"},
} {
ctx := context.New(
config.Project{
Before: config.Before{
Hooks: tc,
},
},
)
assert.Error(t, Pipe{}.Run(ctx))
}
}