func TestValidatePathsCheatConfigPath(t *testing.T) {

	// mock the user's home directory
	home := "/home/foo"

	// mock some envvars
	envvars := map[string]string{
		"XDG_CONFIG_HOME":   "/home/bar",
		"CHEAT_CONFIG_PATH": "/home/baz/conf.yml",
	}

	// get the paths for the platform
	paths, err := Paths("linux", home, envvars)
	if err != nil {
		t.Errorf("paths returned an error: %v", err)
	}

	// specify the expected output
	want := []string{
		"/home/baz/conf.yml",
	}

	// assert that output matches expectations
	if !reflect.DeepEqual(paths, want) {
		t.Errorf(
			"failed to return expected paths: want:\n%s, got:\n%s",
			spew.Sdump(want),
			spew.Sdump(paths),
		)
	}
}
// TestValidatePathsCheatConfigPath asserts that the proper config path is
// returned when `CHEAT_CONFIG_PATH` is explicitly specified.
TestValidatePathsCheatConfigPath asserts that the proper config path is
returned when `CHEAT_CONFIG_PATH` is explicitly specified.
// TestValidatePathsCheatConfigPath asserts that the proper config path is // returned when ` CHEAT_CONFIG_PATH ` is explicitly specified .
func TestValidatePathsCheatConfigPath(t *testing.T) {
	home := "/home/foo"
	envvars := map[string]string{
		"XDG_CONFIG_HOME":   "/home/bar",
		"CHEAT_CONFIG_PATH": "/home/baz/conf.yml",
	}
	paths, err := Paths("linux", home, envvars)
	if err != nil {
		t.Errorf("paths returned an error: %v", err)
	}
	want := []string{
		"/home/baz/conf.yml",
	}
	if !reflect.DeepEqual(paths, want) {
		t.Errorf(
			"failed to return expected paths: want:\n%s, got:\n%s",
			spew.Sdump(want),
			spew.Sdump(paths),
		)
	}
}
func TestValidatePathsCheatConfigPath ( t * testing . T ) { home := " " envvars := map [ string ] string { " " : " " , " " : " " , } paths , err := Paths ( " " , home , envvars ) if err != nil { t . Errorf ( " " , err ) } want := [ ] string { " " , } if ! reflect . DeepEqual ( paths , want ) { t . Errorf ( " \n \n " , spew . Sdump ( want ) , spew . Sdump ( paths ) , ) } }
TestValidatePathsCheatConfigPath asserts that the proper config path is
returned when `CHEAT_CONFIG_PATH` is explicitly specified.
TestValidatePathsCheatConfigPath asserts that the proper config path is returned when ` CHEAT_CONFIG_PATH ` is explicitly specified .
// mock the user's home directory // mock some envvars // get the paths for the platform // specify the expected output // assert that output matches expectations