Skip to content

Commit 12a8802

Browse files
committed
clarify test string
1 parent e187cea commit 12a8802

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

modules/actions/workflows_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,25 @@ import (
99
"code.gitea.io/gitea/modules/git"
1010
"code.gitea.io/gitea/modules/setting"
1111
api "code.gitea.io/gitea/modules/structs"
12+
"code.gitea.io/gitea/modules/test"
1213
webhook_module "code.gitea.io/gitea/modules/webhook"
1314

1415
"github.com/stretchr/testify/assert"
1516
)
1617

17-
func fullWorkflowContent(yamlOn string) []byte {
18-
return []byte("name: test\n" + yamlOn + "\njobs:\n test:\n runs-on: ubuntu-latest\n steps:\n - run: echo hello\n")
18+
func fullWorkflowContent(part string) []byte {
19+
return []byte(`name: test
20+
` + part + `
21+
jobs:
22+
test:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- run: echo hello
26+
`)
1927
}
2028

2129
func TestIsWorkflow(t *testing.T) {
22-
oldDirs := setting.Actions.WorkflowDirs
23-
defer func() {
24-
setting.Actions.WorkflowDirs = oldDirs
25-
}()
30+
defer test.MockVariableValue(&setting.Actions.WorkflowDirs)()
2631

2732
tests := []struct {
2833
name string

0 commit comments

Comments
 (0)