Пример #1
0
func TestConfigWindows(t *testing.T) {
	os.Setenv("APPDATA", appdata)
	defer os.Unsetenv("APPDATA")
	config := gohome.Config(appName)
	assert.NotEmpty(t, config)
	assert.Equal(t, appdata+appName, config)
}
Пример #2
0
func TestConfigXdgSet(t *testing.T) {
	xdgConfig := home + "/.xdgconfig/"
	os.Setenv("XDG_CONFIG_HOME", xdgConfig)
	defer os.Unsetenv("XDG_CONFIG_HOME")
	config := gohome.Config(appName)
	assert.NotEmpty(t, config)
	assert.Equal(t, xdgConfig+appName, config)
}
Пример #3
0
func TestConfig(t *testing.T) {
	config := gohome.Config(appName)
	assert.NotEmpty(t, config)
	assert.Equal(t, home+"/Library/Application Support/"+appName, config)
}
Пример #4
0
func TestConfigXdgUnset(t *testing.T) {
	config := gohome.Config(appName)
	assert.NotEmpty(t, config)
	assert.Equal(t, home+"/.config/"+appName, config)
}