Skip to content

Commit de6f27c

Browse files
techygrrrlAllison DurhamAllison Durham
authored
Added example test for supportin runner/local (#11) (#14)
Co-authored-by: Allison Durham <alliewayy@gmail.com> Co-authored-by: Allison Durham <AdjetiveAllison@gmail.com>
1 parent 63f4402 commit de6f27c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

utils/os_utils_linux_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,26 @@ func TestIsLinux(t *testing.T) {
1515

1616
func TestUserConfigDirLinux(t *testing.T) {
1717
path, err := os.UserConfigDir()
18+
home := os.Getenv("HOME")
19+
if home == "" {
20+
home = "/home/runner"
21+
}
1822

1923
t.Logf("🧵 Config dir: %s", path)
2024

2125
assert.Nil(t, err)
22-
assert.Equal(t, "/home/runner/.config", path)
26+
assert.Equal(t, fmt.Sprintf("%s/.config", home), path)
2327
}
2428

2529
func TestUserConfigFilePathLinux(t *testing.T) {
2630
path, err := ConfigFilePath()
31+
home := os.Getenv("HOME")
32+
if home == "" {
33+
home = "/home/runner"
34+
}
2735

2836
t.Logf("🧵 Config file path: %s", path)
2937

3038
assert.Nil(t, err)
31-
assert.Equal(t, "/home/runner/.config/timerrr/timers.json", path)
39+
assert.Equal(t, fmt.Sprintf("%s/.config/timerrr/timers.json", home), path)
3240
}

0 commit comments

Comments
 (0)