1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-03 00:57:43 +02:00

fix: pluralize blob in the config file (#1095)

* fix: pluralize blob in the config file

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: added tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker
2019-08-02 16:17:38 -03:00
committed by GitHub
parent 7871c58ac2
commit 844f95a2d0
5 changed files with 55 additions and 13 deletions

View File

@ -7,6 +7,8 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/require"
"github.com/goreleaser/goreleaser/internal/artifact"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/goreleaser/goreleaser/pkg/config"
@ -15,7 +17,7 @@ import (
)
func TestDescription(t *testing.T) {
assert.NotEmpty(t, Pipe{}.String())
require.NotEmpty(t, Pipe{}.String())
}
func TestNoBlob(t *testing.T) {
@ -60,8 +62,13 @@ func TestDefaultsNoProvider(t *testing.T) {
}
func TestDefaults(t *testing.T) {
var assert = assert.New(t)
var ctx = context.New(config.Project{
Blob: []config.Blob{
{
Bucket: "foobar",
Provider: "gcs",
},
},
Blobs: []config.Blob{
{
Bucket: "foo",
@ -70,13 +77,20 @@ func TestDefaults(t *testing.T) {
},
},
})
assert.NoError(Pipe{}.Default(ctx))
assert.Equal([]config.Blob{{
Bucket: "foo",
Provider: "azblob",
Folder: "{{ .ProjectName }}/{{ .Tag }}",
IDs: []string{"foo", "bar"},
}}, ctx.Config.Blobs)
require.NoError(t, Pipe{}.Default(ctx))
require.Equal(t, []config.Blob{
{
Bucket: "foo",
Provider: "azblob",
Folder: "{{ .ProjectName }}/{{ .Tag }}",
IDs: []string{"foo", "bar"},
},
{
Bucket: "foobar",
Provider: "gcs",
Folder: "{{ .ProjectName }}/{{ .Tag }}",
},
}, ctx.Config.Blobs)
}
func TestDefaultsWithProvider(t *testing.T) {