File tree 1 file changed +4
-2
lines changed
internal/cli/configuration
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 16
16
package configuration
17
17
18
18
import (
19
+ "path/filepath"
19
20
"testing"
20
21
21
22
"github.com/stretchr/testify/require"
@@ -41,8 +42,9 @@ func TestInit(t *testing.T) {
41
42
}
42
43
43
44
func TestFindConfigFile (t * testing.T ) {
45
+ defaultConfigFile := filepath .Join (getDefaultArduinoDataDir (), "arduino-cli.yaml" )
44
46
configFile := FindConfigFileInArgsFallbackOnEnv ([]string {"--config-file" })
45
- require .Equal (t , "" , configFile )
47
+ require .Equal (t , defaultConfigFile , configFile )
46
48
47
49
configFile = FindConfigFileInArgsFallbackOnEnv ([]string {"--config-file" , "some/path/to/config" })
48
50
require .Equal (t , "some/path/to/config" , configFile )
@@ -51,7 +53,7 @@ func TestFindConfigFile(t *testing.T) {
51
53
require .Equal (t , "some/path/to/config/arduino-cli.yaml" , configFile )
52
54
53
55
configFile = FindConfigFileInArgsFallbackOnEnv ([]string {})
54
- require .Equal (t , "" , configFile )
56
+ require .Equal (t , defaultConfigFile , configFile )
55
57
56
58
t .Setenv ("ARDUINO_CONFIG_FILE" , "some/path/to/config" )
57
59
configFile = FindConfigFileInArgsFallbackOnEnv ([]string {})
You can’t perform that action at this time.
0 commit comments