From 3768f439ac866c473760b48d6795ad50b47fe729 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 30 Jul 2024 20:39:32 +0200 Subject: [PATCH] Added test --- internal/cli/configuration/configuration_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/cli/configuration/configuration_test.go b/internal/cli/configuration/configuration_test.go index 7f15f3cdf59..8e448fa15b7 100644 --- a/internal/cli/configuration/configuration_test.go +++ b/internal/cli/configuration/configuration_test.go @@ -19,6 +19,7 @@ import ( "path/filepath" "testing" + "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/require" ) @@ -63,3 +64,11 @@ func TestFindConfigFile(t *testing.T) { configFile = FindConfigFlagsInArgsOrFallbackOnEnv([]string{"--config-file", "flag/path"}) require.Equal(t, "flag/path", configFile) } + +func TestFindConfigDir(t *testing.T) { + // Check behaviour with --config-dir + expected, err := paths.New("anotherpath", "arduino-cli.yaml").Abs() + require.NoError(t, err) + configFile := FindConfigFlagsInArgsOrFallbackOnEnv([]string{"--config-dir", "anotherpath"}) + require.Equal(t, expected.String(), configFile) +}