Skip to content

Commit

Permalink
fix test Xdg
Browse files Browse the repository at this point in the history
  • Loading branch information
tutilus committed Sep 3, 2024
1 parent 9676e68 commit 2cbda4d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,13 @@ var _ = Describe("Cli", func() {
When("there is a config file in the XDG config directory", func() {
It("should read the config file from disk", func() {
inputConfigHome, _ := homedir.Dir()
inputConfigHome += "/.config/ticker"
inputConfigHome += "/.config"
os.Setenv("XDG_CONFIG_HOME", inputConfigHome)
inputConfigPath := ""
depLocal.Fs.MkdirAll(inputConfigHome, 0755)
depLocal.Fs.Create(inputConfigHome + "/ticker.yaml")
afero.WriteFile(depLocal.Fs, inputConfigHome+"/ticker.yaml", []byte("watchlist:\n - AMD"), 0644)
depLocal.Fs.MkdirAll(inputConfigHome+"/ticker", 0755)
configFile := inputConfigHome + "/ticker/ticker.yaml"
depLocal.Fs.Create(configFile)
afero.WriteFile(depLocal.Fs, configFile, []byte("watchlist:\n - AMD"), 0644)
outputConfig, outputErr := GetConfig(depLocal, inputConfigPath, cli.Options{})
os.Unsetenv("XDG_CONFIG_HOME")

Expand Down

0 comments on commit 2cbda4d

Please sign in to comment.