1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

test: brew tests

Added more tests to cover defaulter.
This commit is contained in:
Carlos Alexandro Becker 2017-12-03 12:05:58 -02:00 committed by Carlos Alexandro Becker
parent 44d01ceccb
commit a432839ad4

View File

@ -268,6 +268,40 @@ func TestRunPipeFormatBinary(t *testing.T) {
assert.False(t, client.CreatedFile)
}
func TestDefault(t *testing.T) {
_, back := testlib.Mktmp(t)
defer back()
var ctx = &context.Context{
Config: config.Project{
Builds: []config.Build{
{
Binary: "foo",
Goos: []string{"linux", "darwin"},
Goarch: []string{"386", "amd64"},
},
{
Binary: "bar",
Goos: []string{"linux", "darwin"},
Goarch: []string{"386", "amd64"},
Ignore: []config.IgnoredBuild{
{Goos: "darwin", Goarch: "amd64"},
},
},
{
Binary: "foobar",
Goos: []string{"linux"},
Goarch: []string{"amd64"},
},
},
},
}
assert.NoError(t, Pipe{}.Default(ctx))
assert.NotEmpty(t, ctx.Config.Brew.CommitAuthor.Name)
assert.NotEmpty(t, ctx.Config.Brew.CommitAuthor.Email)
assert.Equal(t, `bin.install "foo"`, ctx.Config.Brew.Install)
}
type DummyClient struct {
CreatedFile bool
Content string