2018-03-12 08:42:31 -03:00
|
|
|
package project
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
2018-08-14 23:50:20 -03:00
|
|
|
"github.com/goreleaser/goreleaser/pkg/config"
|
|
|
|
"github.com/goreleaser/goreleaser/pkg/context"
|
2018-03-12 08:42:31 -03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCustomProjectName(t *testing.T) {
|
|
|
|
var ctx = context.New(config.Project{
|
|
|
|
ProjectName: "foo",
|
|
|
|
Release: config.Release{
|
|
|
|
GitHub: config.Repo{
|
|
|
|
Owner: "bar",
|
|
|
|
Name: "bar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
require.NoError(t, Pipe{}.Default(ctx))
|
|
|
|
require.Equal(t, "foo", ctx.Config.ProjectName)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestEmptyProjectName(t *testing.T) {
|
|
|
|
var ctx = context.New(config.Project{
|
|
|
|
Release: config.Release{
|
|
|
|
GitHub: config.Repo{
|
|
|
|
Owner: "bar",
|
|
|
|
Name: "bar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
require.NoError(t, Pipe{}.Default(ctx))
|
|
|
|
require.Equal(t, "bar", ctx.Config.ProjectName)
|
|
|
|
}
|