1
0
Fork 0
woodpecker-pipeline-transform/drone/conditions_test.go
2022-07-28 23:05:53 +03:00

23 lines
582 B
Go

// Copyright 2022 Lauris BH. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package drone
import (
"testing"
"codeberg.org/lafriks/woodpecker-pipeline-transform/core"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
)
func TestConditionUnmarshal(t *testing.T) {
v := &struct {
Refs *Conditions `yaml:"refs"`
}{}
err := yaml.Unmarshal([]byte("refs:\n- test1\n- test2\n"), v)
assert.NoError(t, err)
assert.ElementsMatch(t, core.Strings{"test1", "test2"}, v.Refs.Conditions)
}