File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,16 @@ func getDefaultConfiguration() *Config {
22
22
}
23
23
}
24
24
25
+ var configurationPath string = getConfigPath ()
26
+
25
27
func getConfigPath () string {
26
- tempDir := os .TempDir ()
28
+ tempDir , _ := ioutil .TempDir ("" , "temp" )
29
+
27
30
return path .Join (tempDir , "config.yaml" )
28
31
}
29
32
30
33
func createFakeConfigFile () error {
31
- configPath := getConfigPath ()
34
+ configPath := configurationPath
32
35
33
36
var buffer bytes.Buffer
34
37
configuration := getDefaultConfiguration ()
@@ -49,7 +52,7 @@ func createFakeConfigFile() error {
49
52
func TestLoadConfiguration (t * testing.T ) {
50
53
_ = createFakeConfigFile ()
51
54
defer deleteFakeConfigFile ()
52
- config , err := LoadConfiguration (getConfigPath () )
55
+ config , err := LoadConfiguration (configurationPath )
53
56
if err != nil {
54
57
t .Error (err )
55
58
}
@@ -58,7 +61,7 @@ func TestLoadConfiguration(t *testing.T) {
58
61
}
59
62
60
63
func deleteFakeConfigFile () {
61
- configPath := getConfigPath ()
64
+ configPath := configurationPath
62
65
_ = os .Remove (configPath )
63
66
}
64
67
You can’t perform that action at this time.
0 commit comments