@@ -32,7 +32,7 @@ func TestOptions(t *testing.T) {
3232 os .Setenv ("NVIMM_CONFIG_DIR" , "/etc/nvimm" )
3333 os .Setenv ("NVIMM_CONFIG_FILE_NAME" , "nvimm.yaml" )
3434 os .Setenv ("NVIMM_PATH" , "/opt/nvimm" )
35- os .Setenv ("NVIMM_CACHE_SUB_DIR " , "the_cache " )
35+ os .Setenv ("NVIMM_CACHE_PATH " , "/opt/nvim/cache " )
3636 defer os .Unsetenv ("NVIMM_CONFIG_DIR" )
3737 defer os .Unsetenv ("NVIMM_CONFIG_FILE_NAME" )
3838 defer os .Unsetenv ("NVIMM_PATH" )
@@ -61,7 +61,7 @@ func TestOptions(t *testing.T) {
6161 assert .Equal (t , filepath .Join (os .Getenv ("NVIMM_CONFIG_DIR" ),
6262 os .Getenv ("NVIMM_CONFIG_FILE_NAME" )), opts .ConfigPath )
6363 assert .Equal (t , os .Getenv ("NVIMM_PATH" ), opts .Path )
64- assert .Equal (t , filepath . Join ( opts .Path , opts .CacheSubDir ), opts . CachePath () )
64+ assert .Equal (t , opts .CachePath , opts .CachePath )
6565 })
6666
6767 t .Run ("should get default values" , func (t * testing.T ) {
@@ -92,13 +92,14 @@ func TestOptions(t *testing.T) {
9292 }
9393
9494 assert .Equal (t , expectedConfigPath , opts .ConfigPath )
95- userCahceDir , err := os .UserCacheDir ()
95+ userHomeDir , err := os .UserHomeDir ()
9696
9797 if err != nil {
9898 t .Fatalf ("error getting user cache dir: %v" , err )
9999 }
100- assert .Equal (t , filepath .Join (userCahceDir , "nvimm" ), opts .Path )
100+ assert .Equal (t , filepath .Join (userHomeDir , ". nvimm" ), opts .Path )
101101 })
102+
102103 t .Run ("should create paths if does not exists" , func (t * testing.T ) {
103104 var opts AppOptions
104105 dir , err := os .MkdirTemp ("" , "nvimm-test-" )
@@ -139,6 +140,6 @@ func TestOptions(t *testing.T) {
139140 assert .DirExists (t , opts .ConfigDir )
140141 assert .FileExists (t , opts .ConfigPath )
141142 assert .DirExists (t , opts .Path )
142- assert .DirExists (t , opts .CachePath () )
143+ assert .DirExists (t , opts .CachePath )
143144 })
144145}
0 commit comments