1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-02 22:05:46 +02:00
goreleaser/config/archive_config_test.go
Carlos Alexandro Becker d2b1cb5d26
added replacements support
fixes #58
2017-01-11 19:24:17 -02:00

28 lines
553 B
Go

package config
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNameTemplate(t *testing.T) {
assert := assert.New(t)
var config = ProjectConfig{
BinaryName: "test",
Git: GitInfo{
CurrentTag: "v1.2.3",
},
Archive: ArchiveConfig{
NameTemplate: "{{.BinaryName}}_{{.Os}}_{{.Arch}}_{{.Version}}",
Replacements: map[string]string{
"darwin": "Darwin",
"amd64": "x86_64",
},
},
}
name, err := config.ArchiveName("darwin", "amd64")
assert.NoError(err)
assert.Equal("test_Darwin_x86_64_v1.2.3", name)
}