2017-12-10 11:28:01 -02:00
|
|
|
package effectiveconfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/goreleaser/goreleaser/internal/testlib"
|
2018-08-14 23:50:20 -03:00
|
|
|
"github.com/goreleaser/goreleaser/pkg/config"
|
|
|
|
"github.com/goreleaser/goreleaser/pkg/context"
|
2020-10-06 09:48:04 -03:00
|
|
|
"github.com/stretchr/testify/require"
|
2017-12-10 11:28:01 -02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestPipeDescription(t *testing.T) {
|
2020-10-06 09:48:04 -03:00
|
|
|
require.NotEmpty(t, Pipe{}.String())
|
2017-12-10 11:28:01 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Test(t *testing.T) {
|
|
|
|
folder, back := testlib.Mktmp(t)
|
|
|
|
defer back()
|
|
|
|
dist := filepath.Join(folder, "dist")
|
2020-10-06 09:48:04 -03:00
|
|
|
require.NoError(t, os.Mkdir(dist, 0755))
|
2017-12-10 11:28:01 -02:00
|
|
|
var ctx = context.New(
|
|
|
|
config.Project{
|
|
|
|
Dist: dist,
|
|
|
|
},
|
|
|
|
)
|
2020-10-06 09:48:04 -03:00
|
|
|
require.NoError(t, Pipe{}.Run(ctx))
|
2017-12-10 11:28:01 -02:00
|
|
|
bts, err := ioutil.ReadFile(filepath.Join(dist, "config.yaml"))
|
2020-10-06 09:48:04 -03:00
|
|
|
require.NoError(t, err)
|
|
|
|
require.NotEmpty(t, string(bts))
|
2017-12-10 11:28:01 -02:00
|
|
|
}
|