1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-15 01:34:21 +02:00

archive format overrides could break brew formula

This commit is contained in:
Carlos Alexandro Becker
2017-07-02 12:01:59 -03:00
parent 28cf506e9e
commit bc64deeb09
6 changed files with 122 additions and 43 deletions

View File

@ -0,0 +1,28 @@
package archiveformat
import (
"testing"
"github.com/goreleaser/goreleaser/config"
"github.com/goreleaser/goreleaser/context"
"github.com/stretchr/testify/assert"
)
func TestFormatFor(t *testing.T) {
var assert = assert.New(t)
var ctx = &context.Context{
Config: config.Project{
Archive: config.Archive{
Format: "tar.gz",
FormatOverrides: []config.FormatOverride{
{
Goos: "windows",
Format: "zip",
},
},
},
},
}
assert.Equal("zip", For(ctx, "windowsamd64"))
assert.Equal("tar.gz", For(ctx, "linux386"))
}