Skip to content

Commit

Permalink
test: add missing file close (#2492)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini authored Jan 9, 2024
1 parent a7157fa commit 2972ed8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions internal/integrationtest/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,10 @@ func TestInitializationOrderOfConfigThroughFlagAndEnv(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

createConfig := func(path *paths.Path, content string) {
f, err := path.Create()
require.NoError(t, err)
_, err = f.WriteString(content)
require.NoError(t, err)
}
tmp := t.TempDir()
cliConfig, envConfig := paths.New(filepath.Join(tmp, "cli.yaml")), paths.New(filepath.Join(tmp, "env.yaml"))
createConfig(cliConfig, `cli-test: "test"`)
createConfig(envConfig, `env-test: "test"`)
cliConfig.WriteFile([]byte(`cli-test: "test"`))
envConfig.WriteFile([]byte(`env-test: "test"`))

// No flag nor env specified.
stdout, _, err := cli.Run("config", "dump", "--format", "json")
Expand Down

0 comments on commit 2972ed8

Please sign in to comment.