MCPcopy Create free account
hub / github.com/temporalio/temporal / TestGetRepoRootDirectory

Function TestGetRepoRootDirectory

tests/testutils/source_root_test.go:10–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestGetRepoRootDirectory(t *testing.T) {
11 t.Parallel()
12 t.Run("env var set", func(t *testing.T) {
13 directory := GetRepoRootDirectory(WithGetenv(func(s string) string {
14 assert.Equal(t, "TEMPORAL_ROOT", s)
15 return "/tmp/temporal"
16 }))
17 assert.Equal(t, "/tmp/temporal", directory)
18 })
19
20 t.Run("env var not set", func(t *testing.T) {
21 directory := GetRepoRootDirectory(WithGetenv(func(s string) string {
22 return ""
23 }))
24 assert.True(
25 t,
26 strings.HasSuffix(directory, "temporal") || strings.HasSuffix(directory, "temporal/"),
27 directory,
28 )
29 })
30}

Callers

nothing calls this directly

Calls 4

GetRepoRootDirectoryFunction · 0.85
WithGetenvFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected