1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-05 13:15:26 +02:00
goreleaser/pkg/config/config_brew_test.go
Carlos Alexandro Becker 04dfb72d57
fix(brew): version and os not being considered
closes #5123

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-09-09 22:25:21 -03:00

40 lines
815 B
Go

package config
import (
"testing"
"github.com/goreleaser/goreleaser/v2/internal/yaml"
"github.com/stretchr/testify/require"
)
func TestBrewDependencies_justString(t *testing.T) {
var actual Homebrew
err := yaml.UnmarshalStrict([]byte(`dependencies: ['xclip']`), &actual)
require.NoError(t, err)
require.Equal(t, Homebrew{
Dependencies: []HomebrewDependency{
{Name: "xclip"},
},
}, actual)
}
func TestBrewDependencies_full(t *testing.T) {
var actual Homebrew
err := yaml.UnmarshalStrict([]byte(`dependencies:
- name: xclip
os: linux
version: '~> v1'
type: optional`), &actual)
require.NoError(t, err)
require.Equal(t, Homebrew{
Dependencies: []HomebrewDependency{
{
Name: "xclip",
Type: "optional",
Version: "~> v1",
OS: "linux",
},
},
}, actual)
}