mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
test: add test for name_template with env var
Add a test for name_template with an env var.
This commit is contained in:
parent
ca3eedfea8
commit
904d4455f4
@ -84,7 +84,7 @@ func TestRunPipeFormatBinary(t *testing.T) {
|
|||||||
folder, back := testlib.Mktmp(t)
|
folder, back := testlib.Mktmp(t)
|
||||||
defer back()
|
defer back()
|
||||||
writeGoodMain(t, folder)
|
writeGoodMain(t, folder)
|
||||||
var binary = filepath.Join(folder, "binary-testing")
|
var binary = filepath.Join(folder, "binary-testing-bar")
|
||||||
var config = config.Project{
|
var config = config.Project{
|
||||||
ProjectName: "testing",
|
ProjectName: "testing",
|
||||||
Dist: folder,
|
Dist: folder,
|
||||||
@ -101,10 +101,12 @@ func TestRunPipeFormatBinary(t *testing.T) {
|
|||||||
},
|
},
|
||||||
Archive: config.Archive{
|
Archive: config.Archive{
|
||||||
Format: "binary",
|
Format: "binary",
|
||||||
NameTemplate: "binary-{{.Binary}}",
|
NameTemplate: "binary-{{.Binary}}-{{.Env.Foo}}",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
assert.NoError(t, Pipe{}.Run(context.New(config)))
|
ctx := context.New(config)
|
||||||
|
ctx.Env = map[string]string{"Foo": "bar"}
|
||||||
|
assert.NoError(t, Pipe{}.Run(ctx))
|
||||||
assert.True(t, exists(binary))
|
assert.True(t, exists(binary))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user