mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-29 01:44:39 +02:00
fix(brew): version and os not being considered
closes #5123 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
4200454d4e
commit
04dfb72d57
@ -175,6 +175,8 @@ func (a *HomebrewDependency) UnmarshalYAML(unmarshal func(interface{}) error) er
|
||||
|
||||
a.Name = dep.Name
|
||||
a.Type = dep.Type
|
||||
a.Version = dep.Version
|
||||
a.OS = dep.OS
|
||||
|
||||
return nil
|
||||
}
|
||||
|
39
pkg/config/config_brew_test.go
Normal file
39
pkg/config/config_brew_test.go
Normal file
@ -0,0 +1,39 @@
|
||||
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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user