Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jul 30, 2024
1 parent 7561cc0 commit 3768f43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/cli/configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path/filepath"
"testing"

"github.com/arduino/go-paths-helper"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -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)
}

0 comments on commit 3768f43

Please sign in to comment.