func TestValidatePathsNix(t *testing.T) {

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

	// mock some envvars
	envvars := map[string]string{
		"XDG_CONFIG_HOME": "/home/bar",
	}

	// specify the platforms to test
	oses := []string{
		"android",
		"darwin",
		"freebsd",
		"linux",
	}

	// test each *nix os
	for _, os := range oses {
		// get the paths for the platform
		paths, err := Paths(os, home, envvars)
		if err != nil {
			t.Errorf("paths returned an error: %v", err)
		}

		// specify the expected output
		want := []string{
			"/home/bar/cheat/conf.yml",
			"/home/foo/.config/cheat/conf.yml",
			"/home/foo/.cheat/conf.yml",
			"/etc/cheat/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),
			)
		}
	}
}
// TestValidatePathsNix asserts that the proper config paths are returned on
// *nix platforms
TestValidatePathsNix asserts that the proper config paths are returned on
*nix platforms
// TestValidatePathsNix asserts that the proper config paths are returned on // * nix platforms
func TestValidatePathsNix(t *testing.T) {
	home := "/home/foo"
	envvars := map[string]string{
		"XDG_CONFIG_HOME": "/home/bar",
	}
	oses := []string{
		"android",
		"darwin",
		"freebsd",
		"linux",
	}
	for _, os := range oses {
		paths, err := Paths(os, home, envvars)
		if err != nil {
			t.Errorf("paths returned an error: %v", err)
		}
		want := []string{
			"/home/bar/cheat/conf.yml",
			"/home/foo/.config/cheat/conf.yml",
			"/home/foo/.cheat/conf.yml",
			"/etc/cheat/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 TestValidatePathsNix ( t * testing . T ) { home := " " envvars := map [ string ] string { " " : " " , } oses := [ ] string { " " , " " , " " , " " , } for _ , os := range oses { paths , err := Paths ( os , 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 ) , ) } } }
TestValidatePathsNix asserts that the proper config paths are returned on
nix platforms
TestValidatePathsNix asserts that the proper config paths are returned on nix platforms
// mock the user's home directory // mock some envvars // specify the platforms to test // test each *nix os // get the paths for the platform // specify the expected output // assert that output matches expectations