@@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gotest.tools/assert"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestReadWorkflow_StringEvent(t *testing.T) {
|
||||
@@ -20,9 +20,10 @@ jobs:
|
||||
`
|
||||
|
||||
workflow, err := ReadWorkflow(strings.NewReader(yaml))
|
||||
assert.NilError(t, err, "read workflow should succeed")
|
||||
assert.NoError(t, err, "read workflow should succeed")
|
||||
|
||||
assert.DeepEqual(t, workflow.On(), []string{"push"})
|
||||
assert.Len(t, workflow.On(), 1)
|
||||
assert.Contains(t, workflow.On(), "push")
|
||||
}
|
||||
|
||||
func TestReadWorkflow_ListEvent(t *testing.T) {
|
||||
@@ -38,9 +39,11 @@ jobs:
|
||||
`
|
||||
|
||||
workflow, err := ReadWorkflow(strings.NewReader(yaml))
|
||||
assert.NilError(t, err, "read workflow should succeed")
|
||||
assert.NoError(t, err, "read workflow should succeed")
|
||||
|
||||
assert.DeepEqual(t, workflow.On(), []string{"push", "pull_request"})
|
||||
assert.Len(t, workflow.On(), 2)
|
||||
assert.Contains(t, workflow.On(), "push")
|
||||
assert.Contains(t, workflow.On(), "pull_request")
|
||||
}
|
||||
|
||||
func TestReadWorkflow_MapEvent(t *testing.T) {
|
||||
@@ -62,7 +65,8 @@ jobs:
|
||||
`
|
||||
|
||||
workflow, err := ReadWorkflow(strings.NewReader(yaml))
|
||||
assert.NilError(t, err, "read workflow should succeed")
|
||||
|
||||
assert.DeepEqual(t, workflow.On(), []string{"push", "pull_request"})
|
||||
assert.NoError(t, err, "read workflow should succeed")
|
||||
assert.Len(t, workflow.On(), 2)
|
||||
assert.Contains(t, workflow.On(), "push")
|
||||
assert.Contains(t, workflow.On(), "pull_request")
|
||||
}
|
||||
|
Reference in New Issue
Block a user