From 1f27c0953568b09b6d5ca951ed9a46c0f7bb4c1e Mon Sep 17 00:00:00 2001 From: Jared Bydeley Date: Mon, 23 Nov 2015 23:19:22 -0500 Subject: [PATCH] Fixed tests for how they are run --- cobra/cmd/helpers_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cobra/cmd/helpers_test.go b/cobra/cmd/helpers_test.go index c3f990b..dc9b3f3 100644 --- a/cobra/cmd/helpers_test.go +++ b/cobra/cmd/helpers_test.go @@ -29,11 +29,9 @@ func reset() { } func TestProjectPath(t *testing.T) { - wd, _ := os.Getwd() - - checkGuess(t, "", "github.com/spf13/hugo", filepath.Join(wd, "github.com", "spf13", "hugo")) - checkGuess(t, "", "spf13/hugo", filepath.Join(wd, "spf13", "hugo")) - checkGuess(t, "", "/bar/foo", filepath.Join(wd, "bar", "foo")) + 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, "", filepath.Join("/", "bar", "foo"), filepath.Join(getSrcPath(), "bar", "foo")) checkGuess(t, "/bar/foo", "baz", filepath.Join("/", "bar", "foo", "baz")) checkGuess(t, "/bar/foo/cmd", "", filepath.Join("/", "bar", "foo")) checkGuess(t, "/bar/foo/command", "", filepath.Join("/", "bar", "foo"))