1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00

fix: covered default with tests

This commit is contained in:
Carlos Alexandro Becker 2018-04-24 20:57:19 -07:00 committed by Carlos Alexandro Becker
parent ea330a9091
commit 41031a42d3

View File

@ -154,14 +154,28 @@ func TestDefault(t *testing.T) {
testlib.GitInit(t)
testlib.GitRemoteAdd(t, "git@github.com:goreleaser/goreleaser.git")
var ctx = &context.Context{
Config: config.Project{},
}
var ctx = context.New(config.Project{})
assert.NoError(t, Pipe{}.Default(ctx))
assert.Equal(t, "goreleaser", ctx.Config.Release.GitHub.Name)
assert.Equal(t, "goreleaser", ctx.Config.Release.GitHub.Owner)
}
func TestDefaultPipeDisabled(t *testing.T) {
_, back := testlib.Mktmp(t)
defer back()
testlib.GitInit(t)
testlib.GitRemoteAdd(t, "git@github.com:goreleaser/goreleaser.git")
var ctx = context.New(config.Project{
Release: config.Release{
Disable: true,
},
})
assert.NoError(t, Pipe{}.Default(ctx))
assert.Equal(t, "", ctx.Config.Release.GitHub.Name)
assert.Equal(t, "", ctx.Config.Release.GitHub.Owner)
}
func TestDefaultFilled(t *testing.T) {
_, back := testlib.Mktmp(t)
defer back()