(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func 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 | } |
nothing calls this directly
no test coverage detected