1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/effectiveconfig/config_test.go
Carlos Alexandro Becker f3fcb48983 test: added tests to effective config pipe
Also renamed the pipe from finalconfig to effectiveconfig
2017-12-10 13:02:48 -02:00

34 lines
723 B
Go

package effectiveconfig
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/goreleaser/goreleaser/config"
"github.com/goreleaser/goreleaser/context"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/stretchr/testify/assert"
)
func TestPipeDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.String())
}
func Test(t *testing.T) {
folder, back := testlib.Mktmp(t)
defer back()
dist := filepath.Join(folder, "dist")
assert.NoError(t, os.Mkdir(dist, 0755))
var ctx = context.New(
config.Project{
Dist: dist,
},
)
assert.NoError(t, Pipe{}.Run(ctx))
bts, err := ioutil.ReadFile(filepath.Join(dist, "config.yaml"))
assert.NoError(t, err)
assert.NotEmpty(t, string(bts))
}