Fixed tests for how they are run

This commit is contained in:
Jared Bydeley 2015-11-23 23:19:22 -05:00
parent 1057f75af9
commit e97dbc5a21

View file

@ -29,11 +29,9 @@ func reset() {
} }
func TestProjectPath(t *testing.T) { func TestProjectPath(t *testing.T) {
wd, _ := os.Getwd() checkGuess(t, "", filepath.Join("github.com", "spf13", "hugo"), filepath.Join(getSrcPath(), "github.com", "spf13", "hugo"))
checkGuess(t, "", filepath.Join("spf13", "hugo"), filepath.Join(getSrcPath(), "github.com", "spf13", "hugo"))
checkGuess(t, "", "github.com/spf13/hugo", filepath.Join(wd, "github.com", "spf13", "hugo")) checkGuess(t, "", filepath.Join("/", "bar", "foo"), filepath.Join(getSrcPath(), "bar", "foo"))
checkGuess(t, "", "spf13/hugo", filepath.Join(wd, "spf13", "hugo"))
checkGuess(t, "", "/bar/foo", filepath.Join(wd, "bar", "foo"))
checkGuess(t, "/bar/foo", "baz", filepath.Join("/", "bar", "foo", "baz")) checkGuess(t, "/bar/foo", "baz", filepath.Join("/", "bar", "foo", "baz"))
checkGuess(t, "/bar/foo/cmd", "", filepath.Join("/", "bar", "foo")) checkGuess(t, "/bar/foo/cmd", "", filepath.Join("/", "bar", "foo"))
checkGuess(t, "/bar/foo/command", "", filepath.Join("/", "bar", "foo")) checkGuess(t, "/bar/foo/command", "", filepath.Join("/", "bar", "foo"))