1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/pipe/effectiveconfig/config_test.go
2018-09-12 14:18:01 -03:00

34 lines
731 B
Go

package effectiveconfig
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context"
"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))
}