mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-06 03:13:48 +02:00
test: improving tests
Moved tests from defaults to build pipe, as it doesnt make sense to be there.
This commit is contained in:
parent
2dfdb4cd61
commit
b77acd2cc7
@ -406,6 +406,27 @@ func TestDefaultPartialBuilds(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestDefaultFillSingleBuild(t *testing.T) {
|
||||
_, back := testlib.Mktmp(t)
|
||||
defer back()
|
||||
|
||||
var ctx = &context.Context{
|
||||
Config: config.Project{
|
||||
Release: config.Release{
|
||||
GitHub: config.Repo{
|
||||
Name: "foo",
|
||||
},
|
||||
},
|
||||
SingleBuild: config.Build{
|
||||
Main: "testreleaser",
|
||||
},
|
||||
},
|
||||
}
|
||||
assert.NoError(t, Pipe{}.Default(ctx))
|
||||
assert.Len(t, ctx.Config.Builds, 1)
|
||||
assert.Equal(t, ctx.Config.Builds[0].Binary, "foo")
|
||||
}
|
||||
|
||||
func exists(file string) bool {
|
||||
_, err := os.Stat(file)
|
||||
return !os.IsNotExist(err)
|
||||
|
@ -90,22 +90,3 @@ func TestFillPartial(t *testing.T) {
|
||||
assert.Empty(t, ctx.Config.Dockers[0].Goarm)
|
||||
assert.Equal(t, "disttt", ctx.Config.Dist)
|
||||
}
|
||||
|
||||
func TestFillSingleBuild(t *testing.T) {
|
||||
_, back := testlib.Mktmp(t)
|
||||
defer back()
|
||||
testlib.GitInit(t)
|
||||
testlib.GitRemoteAdd(t, "git@github.com:goreleaser/goreleaser.git")
|
||||
|
||||
var ctx = &context.Context{
|
||||
Config: config.Project{
|
||||
SingleBuild: config.Build{
|
||||
Main: "testreleaser",
|
||||
},
|
||||
},
|
||||
}
|
||||
assert.NoError(t, Pipe{}.Run(ctx))
|
||||
assert.Len(t, ctx.Config.Builds, 1)
|
||||
assert.Equal(t, ctx.Config.Builds[0].Binary, "goreleaser")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user