1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/project/project_test.go
Carlos Alexandro Becker 36c49b1306
fix: separated defaulter for project name
this was first broken in 5830759958
and hotfixed in 093291f3ad

I believe this is a better fix
2018-03-12 08:42:31 -03:00

38 lines
742 B
Go

package project
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/goreleaser/goreleaser/config"
"github.com/goreleaser/goreleaser/context"
)
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)
}