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
Carlos Alexandro Becker 979f8632b7
refactor: use require on all tests (#1839)
* refactor: use require on all tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: use require on all tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-06 12:48:04 +00:00

34 lines
737 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/require"
)
func TestPipeDescription(t *testing.T) {
require.NotEmpty(t, Pipe{}.String())
}
func Test(t *testing.T) {
folder, back := testlib.Mktmp(t)
defer back()
dist := filepath.Join(folder, "dist")
require.NoError(t, os.Mkdir(dist, 0755))
var ctx = context.New(
config.Project{
Dist: dist,
},
)
require.NoError(t, Pipe{}.Run(ctx))
bts, err := ioutil.ReadFile(filepath.Join(dist, "config.yaml"))
require.NoError(t, err)
require.NotEmpty(t, string(bts))
}