mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
38 lines
750 B
Go
38 lines
750 B
Go
package project
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/goreleaser/goreleaser/pkg/config"
|
|
"github.com/goreleaser/goreleaser/pkg/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)
|
|
}
|