MCPcopy Index your code
hub / github.com/commitdev/zero / TestGenerateModules

Function TestGenerateModules

internal/generate/generate_test.go:25–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestGenerateModules(t *testing.T) {
26 teardown, tmpDir := setupTeardown(t)
27 defer teardown(t)
28
29 projectConfig := projectconfig.ZeroProjectConfig{
30 Name: "foo",
31 Modules: projectconfig.Modules{
32 "mod1": projectconfig.NewModule(map[string]string{"test": "bar"}, tmpDir, "github.com/fake-org/repo-foo", baseTestFixturesDir, []string{}, []projectconfig.Condition{}),
33 },
34 }
35 generate.Generate(projectConfig, true)
36
37 content, err := ioutil.ReadFile(filepath.Join(tmpDir, "file_to_template.txt"))
38 assert.NoError(t, err)
39
40 expectedContent := `Name is foo
41Params.test is bar
42Files.Repository is github.com/fake-org/repo-foo
43`
44 assert.Equal(t, string(content), expectedContent)
45}

Callers

nothing calls this directly

Calls 3

NewModuleFunction · 0.92
GenerateFunction · 0.92
setupTeardownFunction · 0.85

Tested by

no test coverage detected