MCPcopy
hub / github.com/puma/puma-dev / LinkTestApps

Function LinkTestApps

dev/devtest/testutils.go:204–219  ·  view source on GitHub ↗
(t *testing.T, workingDirPath string, testAppsToLink map[string]string)

Source from the content-addressed store, hash-verified

202}
203
204func LinkTestApps(t *testing.T, workingDirPath string, testAppsToLink map[string]string) func() {
205 MakeDirectoryOrFail(t, workingDirPath)
206
207 for appLinkName, etcAppDir := range testAppsToLink {
208 appPath := filepath.Join(ProjectRoot, "etc", etcAppDir)
209 linkPath := filepath.Join(homedir.MustExpand(workingDirPath), appLinkName)
210
211 if err := os.Symlink(appPath, linkPath); err != nil {
212 assert.FailNow(t, err.Error())
213 }
214 }
215
216 return func() {
217 RemoveDirectoryOrFail(t, workingDirPath)
218 }
219}
220
221func LinkAllTestApps(t *testing.T, workingDirPath string) func() {
222 testAppsToLink := map[string]string{

Callers 1

LinkAllTestAppsFunction · 0.85

Calls 3

MustExpandFunction · 0.92
MakeDirectoryOrFailFunction · 0.85
RemoveDirectoryOrFailFunction · 0.85

Tested by

no test coverage detected