File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff 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 + "\n jobs:\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
2129func 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
You can’t perform that action at this time.
0 commit comments